Skip to content

Commit

Permalink
Fix brave/brave-ios#7517: Fix for zombie tabs during tab selection (b…
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon-T authored May 26, 2023
1 parent f63c005 commit c251693
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Sources/Brave/Frontend/Browser/TabManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,15 @@ class TabManager: NSObject {
UIImpactFeedbackGenerator(style: .light).bzzt()
selectedTab?.createWebview()
selectedTab?.lastExecutedTime = Date.now()

if let selectedTab = selectedTab,
let webView = selectedTab.webView,
webView.url == nil {

selectedTab.url = selectedTab.url ?? TabManager.ntpInteralURL
restoreTab(selectedTab)
Logger.module.error("Force Restored a Zombie Tab?!")
}

delegates.forEach { $0.get()?.tabManager(self, didSelectedTabChange: tab, previous: previous) }
if let tab = previous {
Expand Down Expand Up @@ -439,7 +448,7 @@ class TabManager: NSObject {
PrivilegedRequest(url: url) as URLRequest :
URLRequest(url: url)
$0.createWebview()
$0.loadRequest(URLRequest(url: url))
$0.loadRequest(request)
}

// Select the most recent.
Expand Down

0 comments on commit c251693

Please sign in to comment.