Skip to content

Commit

Permalink
clean up some more
Browse files Browse the repository at this point in the history
  • Loading branch information
SabrinaTardio committed Nov 27, 2023
1 parent 92c9b3e commit acfa3b3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 15 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class SettingsViewController: UITableViewController {
}

private var shouldShowSyncCell: Bool {
return true
return featureFlagger.isFeatureOn(.sync)
}

private var shouldShowTextSizeCell: Bool {
Expand Down
6 changes: 1 addition & 5 deletions DuckDuckGo/SyncSettingsViewController+SyncDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ extension SyncSettingsViewController: SyncManagementViewModelDelegate {
collectCode(showConnectMode: true)
}

func showSyncWithAnotherDeviceEnterText() {
collectCode(showConnectMode: syncService.account == nil, showEnterTextCode: true)
}

func showRecoverData() {
dismissPresentedViewController()
collectCode(showConnectMode: false)
Expand Down Expand Up @@ -109,7 +105,7 @@ extension SyncSettingsViewController: SyncManagementViewModelDelegate {
}
}

private func collectCode(showConnectMode: Bool, showEnterTextCode: Bool = false) {
private func collectCode(showConnectMode: Bool) {
let model = ScanOrPasteCodeViewModel(showConnectMode: showConnectMode, recoveryCode: recoveryCode.isEmpty ? nil : recoveryCode)
model.delegate = self

Expand Down
9 changes: 0 additions & 9 deletions DuckDuckGo/SyncSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,6 @@ class SyncSettingsViewController: UIHostingController<SyncSettingsView> {
presentedViewController.dismiss(animated: true, completion: nil)
}
}
// guard let vc = navigationController?.topViewController else { return }
// guard let view = vc.view else { return }
// if !(view is SyncSettingsView) {
// vc.dismiss(animated: true)
// }
}

func refreshDevices(clearDevices: Bool = true) {
Expand Down Expand Up @@ -194,13 +189,9 @@ extension SyncSettingsViewController: ScanOrPasteCodeViewModelDelegate {
}

func loginAndShowDeviceConnected(recoveryKey: SyncCode.RecoveryKey, isActiveSyncDevice: Bool) async throws {
// let knownDevices = Set(self.rootView.model.devices.map { $0.id })
let registeredDevices = try await syncService.login(recoveryKey, deviceName: deviceName, deviceType: deviceType)
mapDevices(registeredDevices)
dismissVCAndShowRecoveryPDF()
// let devices = self.rootView.model.devices.filter { !knownDevices.contains($0.id) && !$0.isThisDevice }
// let isSecondDevice = devices.count == 1
// showDeviceConnected(devices, optionsModel: self.rootView.model, isSingleSetUp: false, shouldShowOptions: isActiveSyncDevice && isSecondDevice)
}

func startPolling() {
Expand Down

0 comments on commit acfa3b3

Please sign in to comment.