Merge pull request #1014 from kiwix/1013-at-start-local-library-is-displayed-quickly

Use webView loading while restoring a tab
This commit is contained in:
Kelson 2024-10-28 07:29:34 +01:00 committed by GitHub
commit 8da29c4042
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -272,6 +272,11 @@ final class BrowserViewModel: NSObject, ObservableObject,
private func restoreBy(tabID: NSManagedObjectID) {
if let tab = try? Database.shared.viewContext.existingObject(with: tabID) as? Tab {
webView.interactionState = tab.interactionState
if webView.url != nil {
// make sure category(.list) is not displayed
// while restoring a tab
isLoading = true
}
Task { [weak self] in
await MainActor.run { [weak self] in
// migrate the tab urls on demand to ZIM scheme