@@ -6,7 +6,6 @@ import 'package:tsdm_client/exceptions/exceptions.dart';
66import 'package:tsdm_client/extensions/date_time.dart' ;
77import 'package:tsdm_client/extensions/fp.dart' ;
88import 'package:tsdm_client/features/authentication/repository/authentication_repository.dart' ;
9- import 'package:tsdm_client/features/authentication/repository/models/models.dart' ;
109import 'package:tsdm_client/features/notification/repository/notification_repository.dart' ;
1110import 'package:tsdm_client/shared/providers/storage_provider/storage_provider.dart' ;
1211import 'package:tsdm_client/utils/logger.dart' ;
@@ -37,24 +36,12 @@ final class AutoNotificationCubit extends Cubit<AutoNoticeState>
3736 }) : _authenticationRepository = authenticationRepository,
3837 _notificationRepository = notificationRepository,
3938 _storageProvider = storageProvider,
40- super (const AutoNoticeStateStopped ()) {
41- _authSub = _authenticationRepository.status.listen (
42- (e) => switch (e) {
43- AuthStatusUnknown () ||
44- AuthStatusLoading () ||
45- AuthStatusNotAuthed () =>
46- stop (),
47- AuthStatusAuthed () => start (null ),
48- },
49- );
50- }
39+ super (const AutoNoticeStateStopped ());
5140
5241 final AuthenticationRepository _authenticationRepository;
5342 final NotificationRepository _notificationRepository;
5443 final StorageProvider _storageProvider;
5544
56- late final StreamSubscription <AuthStatus > _authSub;
57-
5845 /// Duration between auto fetch actions.
5946 Duration duration;
6047
@@ -179,7 +166,6 @@ final class AutoNotificationCubit extends Cubit<AutoNoticeState>
179166 @override
180167 Future <void > close () async {
181168 _timer? .cancel ();
182- await _authSub.cancel ();
183169 await super .close ();
184170 }
185171}
0 commit comments