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

Refactor FXIOS-7324 [v121.1] Add missing credit card option for FxA syncing in the choose what to sync list (backport #17678) #17813

Merged
merged 1 commit into from
Jan 1, 2024
Merged
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
6 changes: 4 additions & 2 deletions RustFxA/FxAWebViewModel.swift
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ private enum RemoteCommand: String {
case profileChanged = "profile:change"
}

class FxAWebViewModel {
class FxAWebViewModel: FeatureFlaggable {
fileprivate let pageType: FxAPageType
fileprivate let profile: Profile
fileprivate var deepLinkParams: FxALaunchParams
@@ -205,6 +205,8 @@ extension FxAWebViewModel {
/// user info (for settings), or by passing CWTS setup info (in case the user is
/// signing up for an account). This latter case is also used for the sign-in state.
private func onSessionStatus(id: Int, webView: WKWebView) {
let autofillCreditCardStatus = featureFlags.isFeatureEnabled(.creditCardAutofillStatus, checking: .buildOnly)
let creditCardCapability = autofillCreditCardStatus ? ", \"creditcards\"" : ""
guard let fxa = profile.rustFxA.accountManager else { return }
let cmd = "fxaccounts:fxa_status"
let typeId = "account_updates"
@@ -229,7 +231,7 @@ extension FxAWebViewModel {
case .emailLoginFlow, .qrCode:
data = """
{ capabilities:
{ choose_what_to_sync: true, engines: ["bookmarks", "history", "tabs", "passwords"] },
{ choose_what_to_sync: true, engines: ["bookmarks", "history", "tabs", "passwords"\(creditCardCapability)] },
}
"""
}