fix: eager artwork dir init, guard back nav on root

This commit is contained in:
edde746
2026-03-27 11:06:22 +01:00
parent a05efef3c8
commit beb78fada0
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -78,6 +78,10 @@ KeyEventResult handleBackKeyAction(KeyEvent event, VoidCallback onBack) {
}
KeyEventResult handleBackKeyNavigation<T>(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));
@@ -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)