Skip to content

Commit

Permalink
feat(neon_talk): Periodically refresh the room list
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <kate@provokateurin.de>
  • Loading branch information
provokateurin committed May 13, 2024
1 parent 3182566 commit b42811d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/neon/neon_talk/lib/src/blocs/talk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,15 @@ class _TalkBloc extends InteractiveBloc implements TalkBloc {
});

unawaited(refresh());

timer = TimerBloc().registerTimer(const Duration(seconds: 30), refresh);
}

@override
final log = Logger('TalkBloc');

final Account account;
late final NeonTimer timer;

@override
final rooms = BehaviorSubject();
Expand All @@ -63,6 +66,7 @@ class _TalkBloc extends InteractiveBloc implements TalkBloc {

@override
void dispose() {
timer.cancel();
unawaited(rooms.close());
unawaited(unreadCounter.close());
super.dispose();
Expand Down

0 comments on commit b42811d

Please sign in to comment.