diff --git a/Support/en.lproj/Localizable.strings b/Support/en.lproj/Localizable.strings index 75e9c405..d64eefdb 100644 --- a/Support/en.lproj/Localizable.strings +++ b/Support/en.lproj/Localizable.strings @@ -95,7 +95,7 @@ "zim_file_missing_indicator.help" = "Zim file is missing."; -"library.zim_file_details.side_panel.message" = "Select a ZIM file to see detail"; +"library.zim_file_details.side_panel.message" = "Select a ZIM file to see details"; "library.zim_file_context.main_page.label" = "Main Page"; "library.zim_file_context.random.label" = "Random Page"; "library.zim_file_context.copy_url" = "Copy URL"; diff --git a/Views/Library/ZimFilesOpened.swift b/Views/Library/ZimFilesOpened.swift index 763fbb32..8bd0334d 100644 --- a/Views/Library/ZimFilesOpened.swift +++ b/Views/Library/ZimFilesOpened.swift @@ -25,6 +25,7 @@ struct ZimFilesOpened: View { animation: .easeInOut ) private var zimFiles: FetchedResults @State private var isFileImporterPresented = false + @EnvironmentObject private var viewModel: LibraryViewModel let dismiss: (() -> Void)? // iOS only var body: some View { @@ -46,6 +47,9 @@ struct ZimFilesOpened: View { Message(text: "zim_file_opened.overlay.no-opened.message".localized) } } + .onChange(of: zimFiles.count) { _ in + viewModel.selectedZimFile = zimFiles.first // makes sure we also nil out, if all ZIMs were unlinked + } // not using OpenFileButton here, because it does not work on iOS/iPadOS 15 when this view is in a modal .fileImporter( isPresented: $isFileImporterPresented,