Remove artificial UI delays

This commit is contained in:
Janez T
2026-03-14 10:24:50 +01:00
parent b42328bd82
commit 5e1912d9f2

View File

@@ -1181,11 +1181,9 @@ class ConnectionProvider with ChangeNotifier {
// behavior, then reconcile with an on-device refresh below. // behavior, then reconcile with an on-device refresh below.
onChannelInfoReceived?.call(channelIdx, '', Uint8List(16), null); onChannelInfoReceived?.call(channelIdx, '', Uint8List(16), null);
// Small delay to allow the response to propagate // Refresh channel from device to reconcile UI state.
await Future.delayed(const Duration(milliseconds: 100)); // BLE commands are processed in order by firmware, so the
// getChannel response reflects the completed deletion.
// Refresh channels to update UI
// The empty channel will trigger removal via onChannelInfoReceived callback
await _activeService.getChannel(channelIdx); await _activeService.getChannel(channelIdx);
} catch (e) { } catch (e) {
_pendingDeletedChannelIndices.remove(channelIdx); _pendingDeletedChannelIndices.remove(channelIdx);
@@ -1438,10 +1436,6 @@ class ConnectionProvider with ChangeNotifier {
); );
debugPrint(' trackSentChannelMessage completed'); debugPrint(' trackSentChannelMessage completed');
// Small delay to ensure the message is in the MessagesProvider list
// before we try to mark it as sent
await Future.delayed(const Duration(milliseconds: 50));
// Use a dummy ACK tag (0) and timeout (0) for channel messages // Use a dummy ACK tag (0) and timeout (0) for channel messages
// This will trigger the callback to mark the message as "sent" // This will trigger the callback to mark the message as "sent"
debugPrint(' Calling onMessageSent callback...'); debugPrint(' Calling onMessageSent callback...');