diff --git a/src/nim_status_client.nim b/src/nim_status_client.nim index 488f00bdba..28198798cd 100644 --- a/src/nim_status_client.nim +++ b/src/nim_status_client.nim @@ -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() diff --git a/src/status/libstatus/accounts.nim b/src/status/libstatus/accounts.nim index bc65c76d06..b17b93734e 100644 --- a/src/status/libstatus/accounts.nim +++ b/src/status/libstatus/accounts.nim @@ -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,20 +132,23 @@ 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) - + finally: # TODO this is needed for now for the retrieving of past messages. We'll either move or remove it later let peer = "enode://44160e22e8b42bd32a06c1532165fa9e096eebedd7fa6d6e5f8bbef0440bc4a4591fe3651be68193a7ec029021cdb496cfe1d7f9f1dc69eb99226e6f39a7a5d4@35.225.221.245:443" diff --git a/src/status/libstatus/accounts/constants.nim b/src/status/libstatus/accounts/constants.nim index a0db92e80d..0ecc65d99d 100644 --- a/src/status/libstatus/accounts/constants.nim +++ b/src/status/libstatus/accounts/constants.nim @@ -92,7 +92,7 @@ let DEFAULT_NETWORKS* = %* [ } ] -let NODE_CONFIG* = %* { +var NODE_CONFIG* = %* { "BrowsersConfig": { "Enabled": true }, diff --git a/ui/app/AppLayouts/Profile/Sections/SignoutContainer.qml b/ui/app/AppLayouts/Profile/Sections/SignoutContainer.qml index afb4bc5c4f..e8ff1685ad 100644 --- a/ui/app/AppLayouts/Profile/Sections/SignoutContainer.qml +++ b/ui/app/AppLayouts/Profile/Sections/SignoutContainer.qml @@ -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(); } } } \ No newline at end of file