bug(@wallet/desktop): Show toast on account removal (#12597)

This commit is contained in:
Cuteivist 2023-11-09 11:26:09 +01:00 committed by GitHub
parent 930d9ef9b7
commit d73c51d380
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 0 deletions

View File

@ -449,6 +449,10 @@ proc connectForNotificationsOnly[T](self: Module[T]) =
let args = AccountArgs(e)
self.view.showToastAccountAdded(args.account.name)
self.events.on(SIGNAL_WALLET_ACCOUNT_DELETED) do(e:Args):
let args = AccountArgs(e)
self.view.showToastAccountRemoved(args.account.name)
self.events.on(SIGNAL_KEYPAIR_NAME_CHANGED) do(e: Args):
let args = KeypairArgs(e)
self.view.showToastKeypairRenamed(args.oldKeypairName, args.keypair.name)

View File

@ -294,6 +294,7 @@ QtObject:
## Signals for in app (ephemeral) notifications
proc showToastAccountAdded*(self: View, name: string) {.signal.}
proc showToastAccountRemoved*(self: View, name: string) {.signal.}
proc showToastKeypairRenamed*(self: View, oldName: string, newName: string) {.signal.}
proc showNetworkEndpointUpdated*(self: View, name: string, isTest: bool, revertedToDefault: bool) {.signal.}
proc showToastKeypairRemoved*(self: View, keypairName: string) {.signal.}

View File

@ -120,6 +120,17 @@ Item {
)
}
function onShowToastAccountRemoved(name: string) {
Global.displayToastMessage(
qsTr("\"%1\" successfully removed").arg(name),
"",
"checkmark-circle",
false,
Constants.ephemeralNotificationType.success,
""
)
}
function onShowToastKeypairRenamed(oldName: string, newName: string) {
Global.displayToastMessage(
qsTr("You successfully renamed your keypair\nfrom \"%1\" to \"%2\"").arg(oldName).arg(newName),