bug(@wallet/desktop): Show toast on account removal (#12597)
This commit is contained in:
parent
930d9ef9b7
commit
d73c51d380
|
@ -449,6 +449,10 @@ proc connectForNotificationsOnly[T](self: Module[T]) =
|
||||||
let args = AccountArgs(e)
|
let args = AccountArgs(e)
|
||||||
self.view.showToastAccountAdded(args.account.name)
|
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):
|
self.events.on(SIGNAL_KEYPAIR_NAME_CHANGED) do(e: Args):
|
||||||
let args = KeypairArgs(e)
|
let args = KeypairArgs(e)
|
||||||
self.view.showToastKeypairRenamed(args.oldKeypairName, args.keypair.name)
|
self.view.showToastKeypairRenamed(args.oldKeypairName, args.keypair.name)
|
||||||
|
|
|
@ -294,6 +294,7 @@ QtObject:
|
||||||
|
|
||||||
## Signals for in app (ephemeral) notifications
|
## Signals for in app (ephemeral) notifications
|
||||||
proc showToastAccountAdded*(self: View, name: string) {.signal.}
|
proc showToastAccountAdded*(self: View, name: string) {.signal.}
|
||||||
|
proc showToastAccountRemoved*(self: View, name: string) {.signal.}
|
||||||
proc showToastKeypairRenamed*(self: View, oldName: string, newName: string) {.signal.}
|
proc showToastKeypairRenamed*(self: View, oldName: string, newName: string) {.signal.}
|
||||||
proc showNetworkEndpointUpdated*(self: View, name: string, isTest: bool, revertedToDefault: bool) {.signal.}
|
proc showNetworkEndpointUpdated*(self: View, name: string, isTest: bool, revertedToDefault: bool) {.signal.}
|
||||||
proc showToastKeypairRemoved*(self: View, keypairName: string) {.signal.}
|
proc showToastKeypairRemoved*(self: View, keypairName: string) {.signal.}
|
||||||
|
|
|
@ -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) {
|
function onShowToastKeypairRenamed(oldName: string, newName: string) {
|
||||||
Global.displayToastMessage(
|
Global.displayToastMessage(
|
||||||
qsTr("You successfully renamed your keypair\nfrom \"%1\" to \"%2\"").arg(oldName).arg(newName),
|
qsTr("You successfully renamed your keypair\nfrom \"%1\" to \"%2\"").arg(oldName).arg(newName),
|
||||||
|
|
Loading…
Reference in New Issue