fix a clear data modal

pull/1023/head
Ryan ZHAO 7 months ago
parent 39efcc4d2b
commit ce8c6bd971

@ -7764,6 +7764,7 @@
CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 479;
DEVELOPMENT_TEAM = SUQ8J2PCT7; DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
@ -7835,6 +7836,7 @@
CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 479;
DEVELOPMENT_TEAM = SUQ8J2PCT7; DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",

@ -164,22 +164,6 @@ final class NukeDataModal: Modal {
} }
} }
private func unknownErrorOccured() {
let modal: ConfirmationModal = ConfirmationModal(
info: ConfirmationModal.Info(
title: "clearDataAll".localized(),
body: .text("clearDataErrorDescriptionGeneric".localized()),
confirmTitle: "clear".localized(),
confirmStyle: .danger,
cancelStyle: .alert_text,
dismissOnConfirm: false
) { [weak self] confirmationModal in
self?.clearDeviceOnly()
}
)
present(modal, animated: true)
}
private func clearEntireAccount(presentedViewController: UIViewController) { private func clearEntireAccount(presentedViewController: UIViewController) {
let dependencies: Dependencies = Dependencies() let dependencies: Dependencies = Dependencies()
@ -239,26 +223,37 @@ final class NukeDataModal: Modal {
let potentiallyMaliciousSnodes = confirmations let potentiallyMaliciousSnodes = confirmations
.compactMap { ($0.value == false ? $0.key : nil) } .compactMap { ($0.value == false ? $0.key : nil) }
guard !potentiallyMaliciousSnodes.isEmpty else { if potentiallyMaliciousSnodes.isEmpty {
self?.unknownErrorOccured() let modal: ConfirmationModal = ConfirmationModal(
return targetView: self?.view,
} info: ConfirmationModal.Info(
title: "clearDataAll".localized(),
let message: String = "clearDataErrorDescription" body: .text("clearDataErrorDescriptionGeneric".localized()),
.putNumber(potentiallyMaliciousSnodes.count) confirmTitle: "clear".localized(),
.put(key: "service_node_id", value: potentiallyMaliciousSnodes.joined(separator: ", ")) confirmStyle: .danger,
.localized() cancelStyle: .alert_text
) { [weak self] _ in
let modal: ConfirmationModal = ConfirmationModal( self?.clearDeviceOnly()
targetView: self?.view, }
info: ConfirmationModal.Info( )
title: "clearDataError".localized(), self?.present(modal, animated: true)
body: .text(message), } else {
cancelTitle: "okay".localized(), let message: String = "clearDataErrorDescription"
cancelStyle: .alert_text .putNumber(potentiallyMaliciousSnodes.count)
.put(key: "service_node_id", value: potentiallyMaliciousSnodes.joined(separator: ", "))
.localized()
let modal: ConfirmationModal = ConfirmationModal(
targetView: self?.view,
info: ConfirmationModal.Info(
title: "clearDataError".localized(),
body: .text(message),
cancelTitle: "okay".localized(),
cancelStyle: .alert_text
)
) )
) self?.present(modal, animated: true)
self?.present(modal, animated: true) }
} }
) )
} }

Loading…
Cancel
Save