diff --git a/src/app/profile/view.nim b/src/app/profile/view.nim index ce80eec103..75e13967d2 100644 --- a/src/app/profile/view.nim +++ b/src/app/profile/view.nim @@ -122,12 +122,9 @@ QtObject: read = getEnsManager proc changePassword(self: ProfileView, password: string, newPassword: string): bool {.slot.} = - try: - if not status_accounts.changeDatabasePassword(self.profile.address, password, newPassword): - return false - except: - return false - quit(QuitSuccess) # quits the app TODO: change this to logout instead when supported + if self.status.accounts.changePassword(self.profile.address, password, newPassword): + quit(QuitSuccess) # quits the app TODO: change this to logout instead when supported + return false proc getLinkPreviewWhitelist*(self: ProfileView): string {.slot.} = result = $(self.status.profile.getLinkPreviewWhitelist()) diff --git a/src/status/accounts.nim b/src/status/accounts.nim index a126a469ab..84a6215efc 100644 --- a/src/status/accounts.nim +++ b/src/status/accounts.nim @@ -76,3 +76,11 @@ proc changeNetwork*(self: AccountModel, fleetConfig: FleetConfig, network: strin statusGoResult = status_settings.saveSetting(Setting.Stickers_Recent, %* {}) if statusGoResult.error != "": error "Error removing all recent stickers", msg=statusGoResult.error + +proc changePassword*(self: AccountModel, keyUID: string, password: string, newPassword: string): bool = + try: + if not status_accounts.changeDatabasePassword(keyUID, password, newPassword): + return false + except: + return false + return true \ No newline at end of file