diff --git a/lib/focus/key_event_utils.dart b/lib/focus/key_event_utils.dart index e156388c..156e70ac 100644 --- a/lib/focus/key_event_utils.dart +++ b/lib/focus/key_event_utils.dart @@ -78,6 +78,10 @@ KeyEventResult handleBackKeyAction(KeyEvent event, VoidCallback onBack) { } KeyEventResult handleBackKeyNavigation(BuildContext context, KeyEvent event, {T? result}) { + // Let system handle back if there's nothing to pop (e.g. root screen) + if (!Navigator.canPop(context)) { + return KeyEventResult.ignored; + } // Handle on KeyUpEvent to prevent double-pop when returning from child screens // (KeyDownEvent can be received by both the popping screen and the returned-to screen) return handleBackKeyAction(event, () => Navigator.pop(context, result)); diff --git a/lib/services/download_storage_service.dart b/lib/services/download_storage_service.dart index 7676929d..0ec7d838 100644 --- a/lib/services/download_storage_service.dart +++ b/lib/services/download_storage_service.dart @@ -40,6 +40,9 @@ class DownloadStorageService { // Reset cached directories to force recalculation _baseDownloadsDir = null; _artworkDirectoryPath = null; + + // Eagerly initialize artwork directory for sync access + await getArtworkDirectory(); } /// Refresh custom path from settings (call when settings change)