Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix #8526: Fix the issue of the share button disappearing #8572

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Sources/Brave/Frontend/Browser/BrowserViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ public class BrowserViewController: UIViewController {
let webView = tab.webView {
updateURLBar()
navigationToolbar.updateBackStatus(webView.canGoBack)
navigationToolbar.updateForwardStatus(webView.canGoForward)
updateForwardStatusIfNeeded(webView: webView)
topToolbar.locationView.loading = tab.loading
}

Expand Down Expand Up @@ -1913,6 +1913,14 @@ public class BrowserViewController: UIViewController {
}
}

func updateForwardStatusIfNeeded(webView: WKWebView) {
if let forwardListItem = webView.backForwardList.forwardList.first, forwardListItem.url.isReaderModeURL {
navigationToolbar.updateForwardStatus(false)
} else {
navigationToolbar.updateForwardStatus(webView.canGoForward)
}
}

func updateUIForReaderHomeStateForTab(_ tab: Tab) {
updateURLBar()
toolbarVisibilityViewModel.toolbarState = .expanded
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ extension BrowserViewController: WKNavigationDelegate {
if tabManager.selectedTab === tab {
updateUIForReaderHomeStateForTab(tab)
}

updateForwardStatusIfNeeded(webView: webView)
soner-yuksel marked this conversation as resolved.
Show resolved Hide resolved
}

public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
Expand Down