diff --git a/Session/Settings/NukeDataModal.swift b/Session/Settings/NukeDataModal.swift index 496855684..4e6a7efc6 100644 --- a/Session/Settings/NukeDataModal.swift +++ b/Session/Settings/NukeDataModal.swift @@ -164,6 +164,22 @@ 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) { ModalActivityIndicatorViewController .present(fromViewController: presentedViewController, canCancel: false) { [weak self] _ in @@ -222,7 +238,7 @@ final class NukeDataModal: Modal { .compactMap { ($0.value == false ? $0.key : nil) } guard !potentiallyMaliciousSnodes.isEmpty else { - self?.deleteAllLocalData() + self?.unknownErrorOccured() return }