[#15944] Set installation name on account creation

This commit is contained in:
Roman Volosovskyi 2023-06-29 10:35:38 +02:00
parent 3058ebe018
commit b953ddb5af
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
4 changed files with 16 additions and 19 deletions

View File

@ -1156,23 +1156,7 @@ RCT_EXPORT_METHOD(deactivateKeepAwake)
- (NSString*) deviceName
{
NSString* deviceName = nil;
if ([self.deviceId rangeOfString:@"iPod"].location != NSNotFound) {
deviceName = @"iPod Touch";
}
else if([self.deviceId rangeOfString:@"iPad"].location != NSNotFound) {
deviceName = @"iPad";
}
else if([self.deviceId rangeOfString:@"iPhone"].location != NSNotFound){
deviceName = @"iPhone";
}
else if([self.deviceId rangeOfString:@"AppleTV"].location != NSNotFound){
deviceName = @"Apple TV";
}
return deviceName;
return [[UIDevice currentDevice] name];;
}
- (NSDictionary *)constantsToExport

View File

@ -4,7 +4,8 @@
[taoensso.timbre :as log]
[react-native.platform :as platform]
[react-native.core :as rn]
[utils.transforms :as types]))
[utils.transforms :as types]
[clojure.string :as string]))
(defn status
[]
@ -387,6 +388,14 @@
:build-id (.-buildId status)
:device-id (.-deviceId status)}))
(defn get-installation-name
[]
;; NOTE(rasom): Only needed for android devices currently
(when platform/android?
(string/join " "
((juxt :model :device-id)
(get-device-model-info)))))
(defn get-node-config
[callback]
(log/debug "[native-module] get-node-config")

View File

@ -80,6 +80,7 @@
:multiaccount/restore-account-and-login
:multiaccount/create-account-and-login)
request {:displayName display-name
:deviceName (native-module/get-installation-name)
:password (ethereum/sha3 (security/safe-unmask-data
password))
:mnemonic (when seed-phrase

View File

@ -26,6 +26,7 @@
(let [db {:networks/current-network config/default-network
:networks/networks (data-store.settings/rpc->networks config/default-networks)
:profile/profile {:installation-id installation-id
:device-name (native-module/get-installation-name)
:log-level config/log-level
:waku-bloom-filter-mode false
:custom-bootnodes nil
@ -59,7 +60,9 @@
{:receiverConfig {:kdfIterations config/default-kdf-iterations
:nodeConfig final-node-config
:settingCurrentNetwork config/default-network
:deviceType utils.platform/os}}))]
:deviceType utils.platform/os
:deviceName
(native-module/get-installation-name)}}))]
(rf/dispatch [:syncing/update-role constants/local-pairing-role-receiver])
(native-module/input-connection-string-for-bootstrapping
connection-string