Skip to content

Commit

Permalink
fix: initialize notifications service after auth repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-Bekhiet committed Sep 8, 2024
1 parent d3daa0d commit 15472ce
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/churchdata_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,6 @@ Future<void> initCore({
localNotificationsPlugin,
);

final notificationsService =
overrides[NotificationsService]?.call() ?? NotificationsService();
GetIt.I.registerSingleton<NotificationsService>(
notificationsService,
signalsReady: notificationsService.runtimeType == NotificationsService,
dispose: (n) => n.dispose(),
);

await Future.wait(
[
GetIt.I<CacheRepository>().openBox('Settings'),
Expand Down Expand Up @@ -145,6 +137,14 @@ Future<void> initCore({
signalsReady: authRepository.runtimeType == AuthRepository,
);

final notificationsService =
overrides[NotificationsService]?.call() ?? NotificationsService();
GetIt.I.registerSingleton<NotificationsService>(
notificationsService,
signalsReady: notificationsService.runtimeType == NotificationsService,
dispose: (n) => n.dispose(),
);

final functionsService =
overrides[FunctionsService]?.call() ?? FunctionsService();
GetIt.I.registerSingleton<FunctionsService>(
Expand Down

0 comments on commit 15472ce

Please sign in to comment.