Skip to content

Commit

Permalink
trello.com/c/F7EV0pKq fixing MR issues
Browse files Browse the repository at this point in the history
  • Loading branch information
leonid174 committed Jan 18, 2025
1 parent 16433ef commit ed5d294
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
6 changes: 6 additions & 0 deletions Adamant/Modules/Chat/ChatLocalization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ import CommonKit
// MARK: - Localization
extension String.adamant {
enum chat {
static var admNoActiveNodesTitle: String {
String.localized("ApiService.InternalError.NoActiveNodesTitle", comment: "No active ADM blockchain nodes")
}
static var admNoActiveNodes: String {
String.localized("ApiService.InternalError.NoActiveNodes", comment: "No active ADM blockchain nodes")
}
static var sendButton: String {
String.localized("ChatScene.Send", comment: "Chat: Send message button")
}
Expand Down
2 changes: 1 addition & 1 deletion Adamant/Modules/Chat/View/ChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ private extension ChatViewController {

func checkNodesEnabled() {
guard viewModel.hasEnabledNode else {
viewModel.dialog.send(.noEnabledNodesAlert({ [weak self] in
viewModel.dialog.send(.showNodesListAlertAction({ [weak self] in
guard let self else { return }
let vc = screensFactory.makeNodesList()
navigationController?.pushViewController(vc, animated: true)
Expand Down
10 changes: 5 additions & 5 deletions Adamant/Modules/Chat/View/Managers/ChatDialogManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ private extension ChatDialogManager {
showMenu(sender: sender)
case .freeTokenAlert:
showFreeTokenAlert()
case .noEnabledNodesAlert(let showAction):
showNoEnabledNodesAlert(showAction: showAction)
case .showNodesListAlertAction(let showAction):
showNodeListAlert(showAction: showAction)
case let .removeMessageAlert(id):
showRemoveMessageAlert(id: id)
case let .reportMessageAlert(id):
Expand Down Expand Up @@ -201,10 +201,10 @@ private extension ChatDialogManager {
dialogService.present(alert, animated: true, completion: nil)
}

func showNoEnabledNodesAlert(showAction: @escaping ()->Void) {
func showNodeListAlert(showAction: @escaping () -> Void) {
let alert = UIAlertController(
title: String.adamant.sharedErrors.admNoActiveNodesTitle,
message: String.adamant.sharedErrors.admNoActiveNodes,
title: String.adamant.chat.admNoActiveNodesTitle,
message: String.adamant.chat.admNoActiveNodes,
preferredStyleSafe: .alert,
source: nil
)
Expand Down
2 changes: 1 addition & 1 deletion Adamant/Modules/Chat/ViewModel/Models/ChatDialog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ enum ChatDialog {
case warning(String)
case richError(Error)
case freeTokenAlert
case noEnabledNodesAlert(()->Void)
case showNodesListAlertAction(() -> Void)
case removeMessageAlert(id: String)
case reportMessageAlert(id: String)
case menu(sender: UIBarButtonItem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,9 @@
/* Shared alert 'Send tokens' */
"Shared.SendTokens" = "💸 Tokens senden";

/* Shared alert 'Review Node List' button. Used on Chat screen. */
"Shared.ReviewNodeList" = "Review ADM node list";

/* Shared alert 'Upload file' */
"Shared.UploadFile" = "📄 Datei hochladen";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,9 @@
/* ShareQR scene: User had not authorized access to write images to photolibrary */
"ShareQR.photolibraryNotAuthorized" = "您需要授权ADAMANT才能使用您的照片库";

/* Shared alert 'Review Node List' button. Used on Chat screen. */
"Shared.ReviewNodeList" = "Review ADM node list";

/* Main tab bar: Account page */
"Tabs.Account" = "帐户";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,6 @@ public extension String.adamant {
String.localizedStringWithFormat(.localized("ApiService.InternalError.NoAdmNodesAvailable", comment: "No active ADM nodes to fetch the partner's %@ address"), coin)
}

public static var admNoActiveNodesTitle: String {
String.localized("ApiService.InternalError.NoActiveNodesTitle", comment: "No active ADM blockchain nodes")
}

public static var admNoActiveNodes: String {
String.localized("ApiService.InternalError.NoActiveNodes", comment: "No active ADM blockchain nodes")
}

public static var notEnoughMoney: String {
String.localized("WalletServices.SharedErrors.notEnoughMoney", comment: "Wallet Services: Shared error, user do not have enought money.")
}
Expand Down

0 comments on commit ed5d294

Please sign in to comment.