mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-12 00:40:28 +00:00
Clear message input after send
This commit is contained in:
@@ -824,6 +824,11 @@ class AppProvider with ChangeNotifier {
|
|||||||
channelName,
|
channelName,
|
||||||
secret,
|
secret,
|
||||||
);
|
);
|
||||||
|
final isEmptyChannelInfo = AppProvider.isDeletedChannelInfo(
|
||||||
|
channelIdx,
|
||||||
|
channelName,
|
||||||
|
secret,
|
||||||
|
);
|
||||||
final contactChannelName = AppProvider.channelContactName(
|
final contactChannelName = AppProvider.channelContactName(
|
||||||
channelIdx,
|
channelIdx,
|
||||||
channelName,
|
channelName,
|
||||||
@@ -858,6 +863,13 @@ class AppProvider with ChangeNotifier {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isEmptyChannelInfo) {
|
||||||
|
debugPrint(
|
||||||
|
' ⏭️ Ignoring empty channel slot $channelIdx during sync',
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Add/update in ChannelsProvider
|
// Add/update in ChannelsProvider
|
||||||
channelsProvider.addOrUpdateChannel(
|
channelsProvider.addOrUpdateChannel(
|
||||||
index: channelIdx,
|
index: channelIdx,
|
||||||
@@ -1857,22 +1869,6 @@ class AppProvider with ChangeNotifier {
|
|||||||
await connectionProvider.syncChannels(maxChannels: channelsToSync);
|
await connectionProvider.syncChannels(maxChannels: channelsToSync);
|
||||||
debugPrint('✅ [AppProvider] Channel sync complete');
|
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
|
// Automatically login to all saved rooms
|
||||||
await _autoLoginToRooms();
|
await _autoLoginToRooms();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user