fix installationId usage; disable in-app logout for now
fix installationId usage; disable in-app logout for now fix
This commit is contained in:
parent
fe82f762bb
commit
116b04a9ef
|
@ -48,7 +48,7 @@ proc mainProc() =
|
|||
var profile = profile.newController(status)
|
||||
engine.setRootContextProperty("profileModel", profile.variant)
|
||||
|
||||
status.events.on("login") do(a: Args):
|
||||
status.events.once("login") do(a: Args):
|
||||
var args = AccountArgs(a)
|
||||
status.startMessenger()
|
||||
chat.init()
|
||||
|
@ -72,7 +72,7 @@ proc mainProc() =
|
|||
initControllers()
|
||||
|
||||
# Handle node.stopped signal when user has logged out
|
||||
status.events.on("nodeStopped") do(a: Args):
|
||||
status.events.once("nodeStopped") do(a: Args):
|
||||
# TODO: remove this once accounts are not tracked in the AccountsModel
|
||||
status.reset()
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ proc getAccountData*(account: GeneratedAccount): JsonNode =
|
|||
"keycard-pairing": nil
|
||||
}
|
||||
|
||||
proc getAccountSettings*(account: GeneratedAccount, defaultNetworks: JsonNode): JsonNode =
|
||||
proc getAccountSettings*(account: GeneratedAccount, defaultNetworks: JsonNode, installationId: string): JsonNode =
|
||||
result = %* {
|
||||
"key-uid": account.keyUid,
|
||||
"mnemonic": account.mnemonic,
|
||||
|
@ -132,16 +132,19 @@ proc getAccountSettings*(account: GeneratedAccount, defaultNetworks: JsonNode):
|
|||
},
|
||||
"appearance": 0,
|
||||
"networks/current-network": "mainnet_rpc",
|
||||
"installation-id": $genUUID()
|
||||
"installation-id": installationId
|
||||
}
|
||||
|
||||
proc setupAccount*(account: GeneratedAccount, password: string): types.Account =
|
||||
try:
|
||||
let storeDerivedResult = storeDerivedAccounts(account, password)
|
||||
let accountData = getAccountData(account)
|
||||
var settingsJSON = getAccountSettings(account, constants.DEFAULT_NETWORKS)
|
||||
let installationId = $genUUID()
|
||||
var settingsJSON = getAccountSettings(account, constants.DEFAULT_NETWORKS, installationId)
|
||||
var nodeConfig = constants.NODE_CONFIG
|
||||
nodeConfig["ShhextConfig"]["InstallationID"] = newJString(installationId)
|
||||
|
||||
result = saveAccountAndLogin(account, $accountData, password, $constants.NODE_CONFIG, $settingsJSON)
|
||||
result = saveAccountAndLogin(account, $accountData, password, $nodeConfig, $settingsJSON)
|
||||
|
||||
except StatusGoException as e:
|
||||
raise newException(StatusGoException, "Error setting up account: " & e.msg)
|
||||
|
|
|
@ -92,7 +92,7 @@ let DEFAULT_NETWORKS* = %* [
|
|||
}
|
||||
]
|
||||
|
||||
let NODE_CONFIG* = %* {
|
||||
var NODE_CONFIG* = %* {
|
||||
"BrowsersConfig": {
|
||||
"Enabled": true
|
||||
},
|
||||
|
|
|
@ -26,10 +26,12 @@ Item {
|
|||
id: btnLogout
|
||||
anchors.top: txtTitle.bottom
|
||||
anchors.topMargin: Theme.padding
|
||||
label: qsTr("Logout")
|
||||
// label: qsTr("Logout")
|
||||
label: qsTr("Exit")
|
||||
|
||||
onClicked: {
|
||||
profileModel.logout();
|
||||
// profileModel.logout();
|
||||
Qt.quit();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue