|
|
|
@ -205,6 +205,23 @@ final class NukeDataModal: Modal {
|
|
|
|
|
case .failure(let error):
|
|
|
|
|
self?.dismiss(animated: true, completion: nil) // Dismiss the loader
|
|
|
|
|
|
|
|
|
|
switch error {
|
|
|
|
|
case NetworkError.timeout, NetworkError.gatewayTimeout:
|
|
|
|
|
let modal: ConfirmationModal = ConfirmationModal(
|
|
|
|
|
targetView: self?.view,
|
|
|
|
|
info: ConfirmationModal.Info(
|
|
|
|
|
title: "clearDataAll".localized(),
|
|
|
|
|
body: .text("clearDataErrorDescriptionGeneric".localized()),
|
|
|
|
|
confirmTitle: "clear".localized(),
|
|
|
|
|
confirmStyle: .danger,
|
|
|
|
|
cancelStyle: .alert_text
|
|
|
|
|
) { [weak self] _ in
|
|
|
|
|
self?.clearDeviceOnly()
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
self?.present(modal, animated: true)
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
let modal: ConfirmationModal = ConfirmationModal(
|
|
|
|
|
targetView: self?.view,
|
|
|
|
|
info: ConfirmationModal.Info(
|
|
|
|
@ -216,6 +233,7 @@ final class NukeDataModal: Modal {
|
|
|
|
|
)
|
|
|
|
|
self?.present(modal, animated: true)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
receiveValue: { confirmations in
|
|
|
|
|
self?.dismiss(animated: true, completion: nil) // Dismiss the loader
|
|
|
|
|