Addressed PR feedback

This commit is contained in:
Andrei Smirnov 2021-08-16 08:53:02 +03:00 committed by Iuri Matias
parent b7ca0aaf14
commit f440995462
2 changed files with 11 additions and 6 deletions

View File

@ -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
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())

View File

@ -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