mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-19 18:18:38 +00:00
Mark mnemonic as shown on revealing it to the user (#12947)
This commit is contained in:
parent
7ee3b0bb57
commit
b819bdb574
@ -86,6 +86,9 @@ proc getMnemonic*(self: Controller): string =
|
|||||||
proc removeMnemonic*(self: Controller) =
|
proc removeMnemonic*(self: Controller) =
|
||||||
self.privacyService.removeMnemonic()
|
self.privacyService.removeMnemonic()
|
||||||
|
|
||||||
|
proc mnemonicWasShown*(self: Controller) =
|
||||||
|
self.settingsService.mnemonicWasShown()
|
||||||
|
|
||||||
proc getMnemonicWordAtIndex*(self: Controller, index: int): string =
|
proc getMnemonicWordAtIndex*(self: Controller, index: int): string =
|
||||||
return self.privacyService.getMnemonicWordAtIndex(index)
|
return self.privacyService.getMnemonicWordAtIndex(index)
|
||||||
|
|
||||||
|
@ -34,6 +34,9 @@ method getMnemonic*(self: AccessInterface): string {.base.} =
|
|||||||
method removeMnemonic*(self: AccessInterface) {.base.} =
|
method removeMnemonic*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method mnemonicWasShown*(self: AccessInterface) {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
method getMnemonicWordAtIndex*(self: AccessInterface, index: int): string {.base.} =
|
method getMnemonicWordAtIndex*(self: AccessInterface, index: int): string {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
@ -75,6 +75,9 @@ method getMnemonic*(self: Module): string =
|
|||||||
method removeMnemonic*(self: Module) =
|
method removeMnemonic*(self: Module) =
|
||||||
self.controller.removeMnemonic()
|
self.controller.removeMnemonic()
|
||||||
|
|
||||||
|
method mnemonicWasShown*(self: Module) =
|
||||||
|
self.controller.mnemonicWasShown()
|
||||||
|
|
||||||
method getMnemonicWordAtIndex*(self: Module, index: int): string =
|
method getMnemonicWordAtIndex*(self: Module, index: int): string =
|
||||||
return self.controller.getMnemonicWordAtIndex(index)
|
return self.controller.getMnemonicWordAtIndex(index)
|
||||||
|
|
||||||
|
@ -41,6 +41,9 @@ QtObject:
|
|||||||
proc removeMnemonic*(self: View) {.slot.} =
|
proc removeMnemonic*(self: View) {.slot.} =
|
||||||
self.delegate.removeMnemonic()
|
self.delegate.removeMnemonic()
|
||||||
|
|
||||||
|
proc mnemonicWasShown*(self: View) {.slot.} =
|
||||||
|
self.delegate.mnemonicWasShown()
|
||||||
|
|
||||||
proc getMnemonicWordAtIndex*(self: View, index: int): string {.slot.} =
|
proc getMnemonicWordAtIndex*(self: View, index: int): string {.slot.} =
|
||||||
return self.delegate.getMnemonicWordAtIndex(index)
|
return self.delegate.getMnemonicWordAtIndex(index)
|
||||||
|
|
||||||
|
@ -102,6 +102,9 @@ QtObject:
|
|||||||
data.success = false
|
data.success = false
|
||||||
error "error: ", procName="removeMnemonic", errDesription = "an error occurred removing mnemonic"
|
error "error: ", procName="removeMnemonic", errDesription = "an error occurred removing mnemonic"
|
||||||
|
|
||||||
|
proc mnemonicWasShown*(self: Service) =
|
||||||
|
self.settingsService.mnemonicWasShown()
|
||||||
|
|
||||||
proc getMnemonicWordAtIndex*(self: Service, index: int): string =
|
proc getMnemonicWordAtIndex*(self: Service, index: int): string =
|
||||||
let mnemonic = self.settingsService.getMnemonic()
|
let mnemonic = self.settingsService.getMnemonic()
|
||||||
if(mnemonic.len == 0):
|
if(mnemonic.len == 0):
|
||||||
|
@ -1000,3 +1000,9 @@ QtObject:
|
|||||||
|
|
||||||
proc getProfileMigrationNeeded*(self: Service): bool =
|
proc getProfileMigrationNeeded*(self: Service): bool =
|
||||||
self.settings.profileMigrationNeeded
|
self.settings.profileMigrationNeeded
|
||||||
|
|
||||||
|
proc mnemonicWasShown*(self: Service) =
|
||||||
|
let response = status_settings.mnemonicWasShown()
|
||||||
|
if(not response.error.isNil):
|
||||||
|
error "error saving mnemonic was shown setting: ", errDescription = response.error.message
|
||||||
|
return
|
||||||
|
@ -101,3 +101,6 @@ proc addOrReplaceSocialLinks*(value: JsonNode): RpcResponse[JsonNode] {.raises:
|
|||||||
|
|
||||||
proc getSocialLinks*(): RpcResponse[JsonNode] {.raises: [Exception].} =
|
proc getSocialLinks*(): RpcResponse[JsonNode] {.raises: [Exception].} =
|
||||||
return core.callPrivateRPC("settings_getSocialLinks")
|
return core.callPrivateRPC("settings_getSocialLinks")
|
||||||
|
|
||||||
|
proc mnemonicWasShown*(): RpcResponse[JsonNode] {.raises: [Exception].} =
|
||||||
|
return core.callPrivateRPC("settings_mnemonicWasShown")
|
||||||
|
@ -130,6 +130,7 @@ StatusStackModal {
|
|||||||
ConfirmSeedPhrasePanel {
|
ConfirmSeedPhrasePanel {
|
||||||
id: confirmSeedPhrase
|
id: confirmSeedPhrase
|
||||||
seedPhrase: root.privacyStore.getMnemonic().split(" ")
|
seedPhrase: root.privacyStore.getMnemonic().split(" ")
|
||||||
|
privacyStore: root.privacyStore
|
||||||
},
|
},
|
||||||
BackupSeedStepBase {
|
BackupSeedStepBase {
|
||||||
id: confirmFirstWord
|
id: confirmFirstWord
|
||||||
|
@ -14,6 +14,7 @@ BackupSeedStepBase {
|
|||||||
|
|
||||||
property var seedPhrase: []
|
property var seedPhrase: []
|
||||||
property bool hideSeed: true
|
property bool hideSeed: true
|
||||||
|
property var privacyStore
|
||||||
|
|
||||||
titleText: qsTr("Write down your 12-word seed phrase to keep offline")
|
titleText: qsTr("Write down your 12-word seed phrase to keep offline")
|
||||||
|
|
||||||
@ -68,6 +69,7 @@ BackupSeedStepBase {
|
|||||||
icon.name: "view"
|
icon.name: "view"
|
||||||
text: qsTr("Reveal seed phrase")
|
text: qsTr("Reveal seed phrase")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
privacyStore.mnemonicWasShown();
|
||||||
hideSeed = false;
|
hideSeed = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,4 +40,8 @@ QtObject {
|
|||||||
function backupData() {
|
function backupData() {
|
||||||
return root.privacyModule.backupData()
|
return root.privacyModule.backupData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function mnemonicWasShown() {
|
||||||
|
root.privacyModule.mnemonicWasShown()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user