diff --git a/app/lib/util/native/tray_helper.dart b/app/lib/util/native/tray_helper.dart index 255ba10b..43b8860c 100644 --- a/app/lib/util/native/tray_helper.dart +++ b/app/lib/util/native/tray_helper.dart @@ -72,7 +72,11 @@ Future hideToTray() async { } // Disable animations - RefenaScope.defaultRef.notifier(sleepProvider).setState((_) => true); + try { + RefenaScope.defaultRef.notifier(sleepProvider).setState((_) => true); + } catch (e) { + _logger.warning('Failed to update sleep state (Refena not yet initialized)', e); + } } Future showFromTray() async { @@ -86,7 +90,11 @@ Future showFromTray() async { } // Enable animations - RefenaScope.defaultRef.notifier(sleepProvider).setState((_) => false); + try { + RefenaScope.defaultRef.notifier(sleepProvider).setState((_) => false); + } catch (e) { + _logger.warning('Failed to update sleep state (Refena not yet initialized)', e); + } } Future destroyTray() async {