Skip to content

Commit

Permalink
Refactor FXIOS-7324 [v121.1] Add missing credit card option for FxA s…
Browse files Browse the repository at this point in the history
…yncing in the choose what to sync list (#17678)

* Refactor FXIOS-7324 [v121] Add missing credit card option for FxA syncing in the choose what to sync list

* Added credit card feature flag as part of it as well

(cherry picked from commit 813fa63)
  • Loading branch information
nbhasin2 authored and mergify[bot] committed Dec 18, 2023
1 parent 6606641 commit a0e6508
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions RustFxA/FxAWebViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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)] },
}
"""
}
Expand Down

0 comments on commit a0e6508

Please sign in to comment.