Skip to content

[trello.com/c/FUnqFz3u] Improve dialogs in crypto sending screens #874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions Adamant/Modules/ChatsList/ComplexTransferViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,26 +146,8 @@ extension ComplexTransferViewController: PagingViewControllerDataSource {
vc.recipientIsReadonly = true
vc.commentsEnabled = service.core.commentsEnabledForRichMessages && partner?.isDummy != true
vc.showProgressView(animated: false)

Task {
guard service.core.hasEnabledNode else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls write in the PR description why did you delete this code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a task, to remove this behavior

vc.showAlertView(
message: ApiServiceError.noEndpointsAvailable(
nodeGroupName: service.core.tokenName
).errorDescription ?? .adamant.sharedErrors.unknownError,
animated: true
)
return
}

guard admService?.core.hasEnabledNode ?? false else {
vc.showAlertView(
message: .adamant.sharedErrors.admNodeErrorMessage(service.core.tokenSymbol),
animated: true
)
return
}

do {
let walletAddress = try await service.core
.getWalletAddress(
Expand Down
28 changes: 15 additions & 13 deletions Adamant/Modules/Wallets/TransferViewControllerBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ extension String.adamant {
static var unknownToken: String {
String.localized("Transaction.UnknownTokenTitle", comment: "Transaction: Unknown token")
}
static var noActiveMessagingNodesTitle: String {
String.localized("TransferScene.NoActiveMessagingNodes", comment: "Message to show when no active messaging nodes dialog")
}
}
}

Expand Down Expand Up @@ -411,6 +414,7 @@ class TransferViewControllerBase: FormViewController {
.store(in: &subscriptions)

walletCore.walletUpdatePublisher
.receive(on: DispatchQueue.main)
.sink { @MainActor [weak self] _ in
self?.reloadFormData()
}
Expand Down Expand Up @@ -821,20 +825,9 @@ class TransferViewControllerBase: FormViewController {
dialogService.showWarning(withMessage: .adamant.sharedErrors.networkError)
return
}

guard
apiServiceCompose.get(.adm)?.hasEnabledNode == true || admReportRecipient == nil
else {
dialogService.showWarning(
withMessage: ApiServiceError.noEndpointsAvailable(
nodeGroupName: NodeGroup.adm.name
).localizedDescription
)
return
}


for group in walletCore.nodeGroups {
guard apiServiceCompose.get(group)?.hasEnabledNode == true else {
guard apiServiceCompose.get(group)?.hasSupportedNode == true else {
dialogService.showWarning(
withMessage: ApiServiceError.noEndpointsAvailable(
nodeGroupName: group.name
Expand All @@ -844,6 +837,15 @@ class TransferViewControllerBase: FormViewController {
}
}

guard
apiServiceCompose.get(.adm)?.hasSupportedNode == true || admReportRecipient == nil
else {
dialogService.showWarning(
withMessage: String.adamant.transfer.noActiveMessagingNodesTitle
)
return
}

var recipient: String = recipientAddress

if let recipientName, recipientName != recipientAddress {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,9 @@
/* Transfer: Processing message */
"TransferScene.SendingFundsProgress" = "Senden…";

/* Transfer: Title text when it is no available messaging (ADM) nodes */
"TransferScene.NoActiveMessagingNodes" = "Keine aktiven Messaging-Knoten. Überprüfen Sie die ADM-Knotenliste.";

/* Transfer: Tokens transfered successfully message */
"TransferScene.TransferSuccessMessage" = "Fertig!";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1243,8 +1243,8 @@
/* Transfer: Processing message */
"TransferScene.SendingFundsProgress" = "Sending tokens…";

/* Transfer: Tokens transfered successfully message */
"TransferScene.TransferSuccessMessage" = "Done!";
/* Transfer: Title text when it is no available messaging (ADM) nodes */
"TransferScene.NoActiveMessagingNodes" = "No active messaging nodes. Review ADM node list.";

/* Wallet Services: Shared error, user do not have enought money. */
"WalletServices.SharedErrors.notEnoughMoney" = "Not enough tokens";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,9 @@
/* Transfer: Processing message */
"TransferScene.SendingFundsProgress" = "Отправляем токены…";

/* Transfer: Title text when it is no available messaging (ADM) nodes */
"TransferScene.NoActiveMessagingNodes" = "Нет доступных нод ADM, чтобы отправить сообщение. Посмотрите список узлов.";

/* Transfer: Tokens transfered successfully message */
"TransferScene.TransferSuccessMessage" = "Готово!";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,9 @@
/* Transfer: Processing message */
"TransferScene.SendingFundsProgress" = "正在发送令牌…";

/* Transfer: Title text when it is no available messaging (ADM) nodes */
"TransferScene.NoActiveMessagingNodes" = "没有活动的消息节点。请查看 ADM 节点列表。";

/* Transfer: Tokens transfered successfully message */
"TransferScene.TransferSuccessMessage" = "完成!";

Expand Down