modify clear data modal with error

pull/1023/head
Ryan ZHAO 1 year ago
parent ca8344db06
commit c3b5925f78

@ -210,9 +210,9 @@ final class NukeDataModal: Modal {
let modal: ConfirmationModal = ConfirmationModal( let modal: ConfirmationModal = ConfirmationModal(
targetView: self?.view, targetView: self?.view,
info: ConfirmationModal.Info( info: ConfirmationModal.Info(
title: "clearDataAll".localized(), title: "clearDataError".localized(),
body: .text("clearDataErrorDescriptionGeneric".localized()), body: .text("clearDataErrorDescriptionGeneric".localized()),
confirmTitle: "clear".localized(), confirmTitle: "clearDeviceOnly".localized(),
confirmStyle: .danger, confirmStyle: .danger,
cancelStyle: .alert_text cancelStyle: .alert_text
) { [weak self] _ in ) { [weak self] _ in
@ -249,21 +249,17 @@ final class NukeDataModal: Modal {
return return
} }
// Otherwise we should warn the user that one or more service node
// failed to delete the data
let message: String = "clearDataErrorDescription"
.putNumber(potentiallyMaliciousSnodes.count)
.put(key: "service_node_id", value: potentiallyMaliciousSnodes.joined(separator: ", "))
.localized()
let modal: ConfirmationModal = ConfirmationModal( let modal: ConfirmationModal = ConfirmationModal(
targetView: self?.view, targetView: self?.view,
info: ConfirmationModal.Info( info: ConfirmationModal.Info(
title: "clearDataError".localized(), title: "clearDataError".localized(),
body: .text(message), body: .text("clearDataErrorDescriptionGeneric".localized()),
cancelTitle: "okay".localized(), confirmTitle: "clearDeviceOnly".localized(),
confirmStyle: .danger,
cancelStyle: .alert_text cancelStyle: .alert_text
) ) { [weak self] _ in
self?.clearDeviceOnly()
}
) )
self?.present(modal, animated: true) self?.present(modal, animated: true)
} }

Loading…
Cancel
Save