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

feat: open password reset link in browser - WPB-11685 #2095

Open
wants to merge 2 commits into
base: release/cycle-3.112
Choose a base branch
from
Open
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 @@ -501,18 +501,9 @@ extension AuthenticationCoordinator {

// MARK: - Modals

/// Opens the browser and reopens the current alert upon dismissal if needed.
/// Opens the URL in the selected browser
private func openURL(_ url: URL) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it only password reset that uses this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I can tell, only the password reset uses the AuthenticationCoordinatorAction.openURL(_:) action, and only the AuthenticationCoordinatorAction.executeActions(_:) method calls it.
Screenshot 2024-10-28 at 12 07 01

let browser = BrowserViewController(url: url)
browser.onDismiss = {
if let alertModel = self.pendingAlert {
self.presenter?.isLoadingViewVisible = false
self.presentAlert(for: alertModel)
self.pendingAlert = nil
}
}

self.presenter?.present(browser, animated: true, completion: nil)
url.open()
}

/// Presents an error alert.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ extension SettingsCellDescriptorFactory {
func resetPasswordElement() -> SettingsCellDescriptorType {
let resetPasswordTitle = L10n.Localizable.Self.Settings.PasswordResetMenu.title
return SettingsExternalScreenCellDescriptor(title: resetPasswordTitle, isDestructive: false, presentationStyle: .modal, presentationAction: {
return BrowserViewController(url: URL.wr_passwordReset)
URL.wr_passwordReset.open()
return nil
}, previewGenerator: .none)
}

Expand Down
Loading