🐛 Fix send empty message

This commit is contained in:
LittleSheep 2025-02-15 18:12:35 +08:00
parent 42ac12b53e
commit c91cf7c813
2 changed files with 2 additions and 1 deletions

View File

@ -154,7 +154,7 @@ class _RealmJoinPopupState extends State<_RealmJoinPopup> {
try {
setState(() => _isBusy = true);
final sn = context.read<SnNetworkProvider>();
final resp = await sn.client.get('/cgi/im/channels/${widget.realm.alias}');
final resp = await sn.client.get('/cgi/im/channels/${widget.realm.alias}/public');
final out = List<SnChannel>.from(
resp.data.map((e) => SnChannel.fromJson(e)).cast<SnChannel>(),
);

View File

@ -112,6 +112,7 @@ class ChatMessageInputState extends State<ChatMessageInput> {
}
Future<void> _sendMessage() async {
if (_contentController.text.isEmpty && _attachments.isEmpty) return;
if (_isBusy) return;
final attach = context.read<SnAttachmentProvider>();