Skip to content

Commit db9ad4b

Browse files
committed
store: Add nullable [PerAccountStore.updateMachine]; dispose in [dispose]
1 parent 1447037 commit db9ad4b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/model/store.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ class PerAccountStore extends ChangeNotifier with ChannelStore, MessageStore {
303303

304304
final GlobalStore _globalStore;
305305
final ApiConnection connection; // TODO(#135): update zulipFeatureLevel with events
306+
UpdateMachine? updateMachine;
306307

307308
bool get isLoading => _isLoading;
308309
bool _isLoading = false;
@@ -420,6 +421,7 @@ class PerAccountStore extends ChangeNotifier with ChannelStore, MessageStore {
420421
unreads.dispose();
421422
_messages.dispose();
422423
typingStatus.dispose();
424+
updateMachine?.dispose(); // TODO is updateMachine ever null except in tests?
423425
super.dispose();
424426
}
425427

@@ -730,6 +732,7 @@ class UpdateMachine {
730732
);
731733
final updateMachine = UpdateMachine.fromInitialSnapshot(
732734
store: store, initialSnapshot: initialSnapshot);
735+
store.updateMachine = updateMachine;
733736
updateMachine.poll();
734737
// TODO do registerNotificationToken before registerQueue:
735738
// https://github.com/zulip/zulip-flutter/pull/325#discussion_r1365982807

0 commit comments

Comments
 (0)