From a7ad4bb8ec7e9c2d19039fd42ed15ea5275832a9 Mon Sep 17 00:00:00 2001 From: Janez T Date: Fri, 13 Mar 2026 19:36:20 +0100 Subject: [PATCH] Clear message input after send --- lib/providers/app_provider.dart | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/lib/providers/app_provider.dart b/lib/providers/app_provider.dart index 11e618c..dfc381a 100644 --- a/lib/providers/app_provider.dart +++ b/lib/providers/app_provider.dart @@ -824,6 +824,11 @@ class AppProvider with ChangeNotifier { channelName, secret, ); + final isEmptyChannelInfo = AppProvider.isDeletedChannelInfo( + channelIdx, + channelName, + secret, + ); final contactChannelName = AppProvider.channelContactName( channelIdx, channelName, @@ -858,6 +863,13 @@ class AppProvider with ChangeNotifier { return; } + if (isEmptyChannelInfo) { + debugPrint( + ' ⏭️ Ignoring empty channel slot $channelIdx during sync', + ); + return; + } + // Add/update in ChannelsProvider channelsProvider.addOrUpdateChannel( index: channelIdx, @@ -1857,22 +1869,6 @@ class AppProvider with ChangeNotifier { await connectionProvider.syncChannels(maxChannels: channelsToSync); debugPrint('✅ [AppProvider] Channel sync complete'); - // Configure the default public channel (channel 0) - // This must be done before sending any channel messages - // Note: Some firmware versions may have this pre-configured - debugPrint( - '📻 [AppProvider] Configuring default public channel (channel 0)...', - ); - try { - await connectionProvider.configureDefaultPublicChannel(); - debugPrint('✅ [AppProvider] Public channel configured successfully'); - } catch (e) { - debugPrint( - '⚠️ [AppProvider] Public channel configuration failed (may already be configured): $e', - ); - // Continue anyway - channel might already be configured in firmware - } - // Automatically login to all saved rooms await _autoLoginToRooms();