feat(@wallet): add account toast

fixes #10510
This commit is contained in:
Anthony Laibe 2023-05-17 08:39:06 +02:00 committed by Iuri Matias
parent 863c4f5d7a
commit 05c8373905
4 changed files with 18 additions and 0 deletions

View File

@ -152,6 +152,7 @@ method load*(self: Module) =
let args = AccountSaved(e)
self.setTotalCurrencyBalance()
self.filter.setAddress(args.account.address)
self.view.showToastAccountAdded(args.account.name)
self.notifyFilterChanged()
self.events.on(SIGNAL_WALLET_ACCOUNT_DELETED) do(e:Args):
let args = AccountDeleted(e)

View File

@ -28,6 +28,8 @@ QtObject:
proc load*(self: View) =
self.delegate.viewDidLoad()
proc showToastAccountAdded*(self: View, name: string) {.signal.}
proc currentCurrencyChanged*(self: View) {.signal.}
proc updateCurrency*(self: View, currency: string) {.slot.} =

View File

@ -137,4 +137,18 @@ Item {
anchors.centerIn: parent
}
}
Connections {
target: RootStore.walletSectionInst
function onShowToastAccountAdded(name: string) {
Global.displayToastMessage(
qsTr("\"%1\" successfuly added").arg(name),
"",
"check-circle",
false,
Constants.ephemeralNotificationType.success,
""
)
}
}
}

View File

@ -27,6 +27,7 @@ QtObject {
property var accountSensitiveSettings: localAccountSensitiveSettings
property bool hideSignPhraseModal: accountSensitiveSettings.hideSignPhraseModal
property var walletSectionInst: walletSection
property var totalCurrencyBalance: walletSection.totalCurrencyBalance
property string signingPhrase: walletSection.signingPhrase
property string mnemonicBackedUp: walletSection.isMnemonicBackedUp