Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix macOS unlink last ZIM file issue #810

Merged

Conversation

BPerlakiH
Copy link
Collaborator

Fixes: #809

zim_delete_fix_macOS.mov

@BPerlakiH BPerlakiH requested review from rgaudin and kelson42 June 15, 2024 21:46
@BPerlakiH BPerlakiH linked an issue Jun 15, 2024 that may be closed by this pull request
@@ -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
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explanation: zimFiles.first returns an optional, so it covers both cases, when there's still files to pick from, and when there's nothing left.

@kelson42 kelson42 merged commit dcc86ed into main Jun 16, 2024
4 checks passed
@kelson42 kelson42 deleted the 809-macos-side-tab-should-update-after-unlinking-a-zim-file branch June 16, 2024 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

macOS: Side tab should update after unlinking a ZIM file
2 participants