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

[iOS] - Fix Translate Crash on iPad (Uplift to 1.77.x) #27870

Merged
merged 1 commit into from
Feb 28, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ class BraveTranslateTabHelper: NSObject {
// Cache CSS and JS requests
Self.requestCache[request.url] = (data, response)

if isTranslationRequest && canShowToast {
canShowToast = false
if isTranslationRequest {
delegate?.updateTranslateURLBar(tab: tab, state: .active)

Task { @MainActor in
self.delegate?.updateTranslateURLBar(tab: tab, state: .active)
self.delegate?.presentToast(tab: tab, languageInfo: currentLanguageInfo)
if canShowToast {
canShowToast = false
delegate?.presentToast(tab: tab, languageInfo: currentLanguageInfo)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ extension BrowserViewController: BraveTranslateScriptHandlerDelegate {
completion(false)
}
),
autoLayoutConfiguration: .init(preferredWidth: self.view.bounds.width - (32.0 * 2.0))
autoLayoutConfiguration: .phoneWidth
)

popover.arrowDistance = 10.0
popover.outerMargins = UIEdgeInsets(equalInset: 16.0)

popover.previewForOrigin = .init(
view: self.topToolbar.locationView.translateButton.then {
Expand Down
Loading