Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32c052d9b4 | ||
|
|
699986c0b2 | ||
|
|
85b5445296 | ||
|
|
cdb2370cf3 | ||
|
|
5d6b46a914 | ||
|
|
77ff5b473b | ||
|
|
ac8b06b6bf | ||
|
|
dc12a0ff97 | ||
|
|
c329d5e69f | ||
|
|
009ac7eec2 |
@@ -36,3 +36,4 @@ TEST_NETWORKS_ENABLED=1
|
||||
SHOW_NOT_IMPLEMENTED_FEATURES=0
|
||||
ENABLE_ALERT_BANNER=0
|
||||
FLAG_WALLET_CONNECT_ENABLED=1
|
||||
LOG_REQUEST_GO=1
|
||||
|
||||
@@ -40,3 +40,4 @@ DELETE_MESSAGE_UNDO_TIME_LIMIT=10000
|
||||
ENABLE_ALERT_BANNER=0
|
||||
FLAG_WALLET_CONNECT_ENABLED=1
|
||||
MOBILE_DATA_SYNCING_TOGGLE_ENABLE=0
|
||||
LOG_REQUEST_GO=1
|
||||
|
||||
@@ -37,3 +37,4 @@ FAST_CREATE_COMMUNITY_ENABLED=1
|
||||
TEST_NETWORKS_ENABLED=1
|
||||
ENABLE_ALERT_BANNER=1
|
||||
FLAG_WALLET_CONNECT_ENABLED=1
|
||||
LOG_REQUEST_GO=1
|
||||
|
||||
@@ -24,3 +24,4 @@ FAST_CREATE_COMMUNITY_ENABLED=0
|
||||
TEST_NETWORKS_ENABLED=0
|
||||
ENABLE_ALERT_BANNER=1
|
||||
FLAG_WALLET_CONNECT_ENABLED=1
|
||||
LOG_REQUEST_GO=0
|
||||
|
||||
@@ -21,3 +21,4 @@ FAST_CREATE_COMMUNITY_ENABLED=0
|
||||
TEST_NETWORKS_ENABLED=0
|
||||
STATUS_PROXY_STAGE_NAME=prod
|
||||
FLAG_WALLET_CONNECT_ENABLED=1
|
||||
LOG_REQUEST_GO=0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.9'
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
|
||||
/* Options section can't access functions in objects. */
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.9'
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
|
||||
import groovy.json.JsonBuilder
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.9'
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.9'
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
|
||||
/* Options section can't access functions in objects. */
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.9'
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
|
||||
/* Options section can't access functions in objects. */
|
||||
def isPRBuild = utils.isPRBuild()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.9'
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
|
||||
pipeline {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.9'
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
|
||||
pipeline {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.9'
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
|
||||
pipeline {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.9'
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
|
||||
pipeline {
|
||||
agent { label 'macos' }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.9'
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
|
||||
pipeline {
|
||||
agent { label params.AGENT_LABEL }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.9'
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env groovy
|
||||
library 'status-jenkins-lib@v1.9.9'
|
||||
library 'status-jenkins-lib@v1.9.10'
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
|
||||
+19
-6
@@ -25,13 +25,18 @@ class LogManager(private val reactContext: ReactApplicationContext) : ReactConte
|
||||
|
||||
override fun getName() = "LogManager"
|
||||
|
||||
private fun getLogsFile(): File {
|
||||
private fun getRequestLogFile(): File {
|
||||
val pubDirectory = utils.getPublicStorageDirectory()
|
||||
return File(pubDirectory, requestsLogFileName)
|
||||
}
|
||||
|
||||
private fun getGethLogFile(): File {
|
||||
val pubDirectory = utils.getPublicStorageDirectory()
|
||||
return File(pubDirectory, gethLogFileName)
|
||||
}
|
||||
|
||||
fun prepareLogsFile(context: Context): File? {
|
||||
val logFile = utils.getLogsFile()
|
||||
val logFile = getGethLogFile()
|
||||
|
||||
try {
|
||||
logFile.setReadable(true)
|
||||
@@ -149,7 +154,8 @@ class LogManager(private val reactContext: ReactApplicationContext) : ReactConte
|
||||
|
||||
val zipFile = File(logsTempDir, logsZipFileName)
|
||||
val statusLogFile = File(logsTempDir, statusLogFileName)
|
||||
val gethLogFile = getLogsFile()
|
||||
val gethLogFile = getGethLogFile()
|
||||
val requestLogFile = getRequestLogFile()
|
||||
|
||||
try {
|
||||
if (zipFile.exists() || zipFile.createNewFile()) {
|
||||
@@ -165,7 +171,11 @@ class LogManager(private val reactContext: ReactApplicationContext) : ReactConte
|
||||
dumpAdbLogsTo(FileOutputStream(statusLogFile))
|
||||
|
||||
val errorList = Stack<String>()
|
||||
val zipped = zip(arrayOf(dbFile, gethLogFile, statusLogFile), zipFile, errorList)
|
||||
val filesToZip = mutableListOf(dbFile, gethLogFile, statusLogFile)
|
||||
if (requestLogFile.exists()) {
|
||||
filesToZip.add(requestLogFile)
|
||||
}
|
||||
val zipped = zip(filesToZip.toTypedArray(), zipFile, errorList)
|
||||
if (zipped && zipFile.exists()) {
|
||||
zipFile.setReadable(true, false)
|
||||
val extUri = FileProvider.getUriForFile(context, "${context.packageName}.provider", zipFile)
|
||||
@@ -186,12 +196,14 @@ class LogManager(private val reactContext: ReactApplicationContext) : ReactConte
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
fun initLogging(enabled: Boolean, mobileSystem: Boolean, logLevel: String, callback: Callback) {
|
||||
fun initLogging(enabled: Boolean, mobileSystem: Boolean, logLevel: String, logRequestGo: Boolean, callback: Callback) {
|
||||
val jsonConfig = JSONObject().apply {
|
||||
put("Enabled", enabled)
|
||||
put("MobileSystem", mobileSystem)
|
||||
put("Level", logLevel)
|
||||
put("File", getLogsFile().absolutePath)
|
||||
put("File", getGethLogFile().absolutePath)
|
||||
put("LogRequestGo", logRequestGo)
|
||||
put("LogRequestFile", getRequestLogFile().absolutePath)
|
||||
}
|
||||
val config = jsonConfig.toString()
|
||||
utils.executeRunnableStatusGoMethod({ Statusgo.initLogging(config) }, callback)
|
||||
@@ -206,6 +218,7 @@ class LogManager(private val reactContext: ReactApplicationContext) : ReactConte
|
||||
private const val TAG = "LogManager"
|
||||
private const val gethLogFileName = "geth.log"
|
||||
private const val statusLogFileName = "Status.log"
|
||||
private const val requestsLogFileName = "requests.log"
|
||||
private const val logsZipFileName = "Status-debug-logs.zip"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import statusgo.Statusgo
|
||||
class Utils(private val reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
|
||||
|
||||
companion object {
|
||||
private const val gethLogFileName = "geth.log"
|
||||
private const val TAG = "Utils"
|
||||
}
|
||||
|
||||
@@ -40,11 +39,6 @@ class Utils(private val reactContext: ReactApplicationContext) : ReactContextBas
|
||||
return reactContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS)
|
||||
}
|
||||
|
||||
fun getLogsFile(): File {
|
||||
val pubDirectory = getPublicStorageDirectory()
|
||||
return File(pubDirectory, gethLogFileName)
|
||||
}
|
||||
|
||||
fun getKeyUID(json: String): String {
|
||||
val jsonObj = JSONObject(json)
|
||||
return jsonObj.getString("key-uid")
|
||||
|
||||
@@ -57,6 +57,8 @@ RCT_EXPORT_METHOD(sendLogs:(NSString *)dbJson
|
||||
NSURL *mainGethLogsFile = [rootUrl URLByAppendingPathComponent:@"geth.log"];
|
||||
NSURL *mainLogsFile = [logsFolderName URLByAppendingPathComponent:@"geth.log"];
|
||||
|
||||
NSURL *requestsLogFile = [rootUrl URLByAppendingPathComponent:@"requests.log"];
|
||||
|
||||
[dbJson writeToFile:dbFile.path atomically:YES encoding:NSUTF8StringEncoding error:nil];
|
||||
[jsLogs writeToFile:jsLogsFile.path atomically:YES encoding:NSUTF8StringEncoding error:nil];
|
||||
|
||||
@@ -65,6 +67,10 @@ RCT_EXPORT_METHOD(sendLogs:(NSString *)dbJson
|
||||
[fileManager copyItemAtPath:originalGethLogsFile.path toPath:gethLogsFile.path error:nil];
|
||||
[fileManager copyItemAtPath:goerliGethLogsFile.path toPath:goerliLogsFile.path error:nil];
|
||||
[fileManager copyItemAtPath:mainGethLogsFile.path toPath:mainLogsFile.path error:nil];
|
||||
|
||||
if ([fileManager fileExistsAtPath:requestsLogFile.path]) {
|
||||
[fileManager copyItemAtPath:requestsLogFile.path toPath:[logsFolderName URLByAppendingPathComponent:@"requests.log"].path error:nil];
|
||||
}
|
||||
|
||||
[SSZipArchive createZipFileAtPath:zipFile.path withContentsOfDirectory:logsFolderName.path];
|
||||
[fileManager removeItemAtPath:logsFolderName.path error:nil];
|
||||
@@ -75,17 +81,20 @@ RCT_EXPORT_METHOD(sendLogs:(NSString *)dbJson
|
||||
RCT_EXPORT_METHOD(initLogging:(BOOL)enabled
|
||||
mobileSystem:(BOOL)mobileSystem
|
||||
logLevel:(NSString *)logLevel
|
||||
logRequestGo:(BOOL)logRequestGo
|
||||
callback:(RCTResponseSenderBlock)callback)
|
||||
{
|
||||
NSString *logDirectory = [self logFileDirectory];
|
||||
NSString *logFilePath = [logDirectory stringByAppendingPathComponent:@"geth.log"];
|
||||
NSString *logRequestFilePath = [logDirectory stringByAppendingPathComponent:@"requests.log"];
|
||||
|
||||
NSMutableDictionary *jsonConfig = [NSMutableDictionary dictionary];
|
||||
jsonConfig[@"Enabled"] = @(enabled);
|
||||
jsonConfig[@"MobileSystem"] = @(mobileSystem);
|
||||
jsonConfig[@"Level"] = logLevel;
|
||||
jsonConfig[@"File"] = logFilePath;
|
||||
|
||||
jsonConfig[@"LogRequestGo"] = @(logRequestGo);
|
||||
jsonConfig[@"LogRequestFile"] = logRequestFilePath;
|
||||
NSError *error = nil;
|
||||
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonConfig options:0 error:&error];
|
||||
|
||||
|
||||
@@ -13,17 +13,19 @@
|
||||
(native-module/logout)))
|
||||
|
||||
(rf/defn initialize-app-db
|
||||
[{{:keys [keycard initials-avatar-font-file biometrics]
|
||||
:network/keys [type status expensive?]}
|
||||
[{{:keys [keycard initials-avatar-font-file biometrics]
|
||||
:network/keys [type status expensive?]
|
||||
:centralized-metrics/keys [user-confirmed?]}
|
||||
:db}]
|
||||
{:db (assoc db/app-db
|
||||
:network/type type
|
||||
:network/status status
|
||||
:network/expensive? expensive?
|
||||
:initials-avatar-font-file initials-avatar-font-file
|
||||
:keycard (dissoc keycard :secrets :pin :application-info)
|
||||
:biometrics biometrics
|
||||
:syncing nil)})
|
||||
:centralized-metrics/user-confirmed? user-confirmed?
|
||||
:network/type type
|
||||
:network/status status
|
||||
:network/expensive? expensive?
|
||||
:initials-avatar-font-file initials-avatar-font-file
|
||||
:keycard (dissoc keycard :secrets :pin :application-info)
|
||||
:biometrics biometrics
|
||||
:syncing nil)})
|
||||
|
||||
(rf/defn logout-method
|
||||
{:events [::logout-method]}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
[legacy.status-im.ui.components.list.views :as list]
|
||||
[quo.core :as quo]
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.feature-flags :as ff]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf])
|
||||
(:require-macros [legacy.status-im.utils.views :as views]))
|
||||
@@ -17,7 +16,6 @@
|
||||
|
||||
(defn- normal-mode-settings-data
|
||||
[{:keys [current-log-level
|
||||
telemetry-enabled?
|
||||
light-client-enabled?
|
||||
store-confirmations-enabled?
|
||||
current-fleet
|
||||
@@ -60,14 +58,6 @@
|
||||
:on-press
|
||||
#(re-frame/dispatch [:open-modal :peers-stats])
|
||||
:chevron true}
|
||||
(when (ff/enabled? ::ff/settings.telemetry)
|
||||
{:size :small
|
||||
:title "Telemetry"
|
||||
:accessibility-label :telemetry-enabled
|
||||
:container-margin-bottom 8
|
||||
:on-press #(re-frame/dispatch [:profile.settings/toggle-telemetry])
|
||||
:accessory :switch
|
||||
:active telemetry-enabled?})
|
||||
{:size :small
|
||||
:title (i18n/label :t/light-client-enabled)
|
||||
:accessibility-label :light-client-enabled
|
||||
@@ -109,7 +99,6 @@
|
||||
[]
|
||||
(views/letsubs [light-client-enabled? [:profile/light-client-enabled?]
|
||||
store-confirmations-enabled? [:profile/store-confirmations-enabled?]
|
||||
telemetry-enabled? [:profile/telemetry-enabled?]
|
||||
current-log-level [:log-level/current-log-level]
|
||||
current-fleet [:fleets/current-fleet]
|
||||
peer-syncing-enabled? [:profile/peer-syncing-enabled?]]
|
||||
@@ -123,7 +112,6 @@
|
||||
[list/flat-list
|
||||
{:data (flat-list-data
|
||||
{:current-log-level current-log-level
|
||||
:telemetry-enabled? telemetry-enabled?
|
||||
:light-client-enabled? light-client-enabled?
|
||||
:store-confirmations-enabled? store-confirmations-enabled?
|
||||
:current-fleet current-fleet
|
||||
|
||||
@@ -531,8 +531,8 @@
|
||||
(.logFileDirectory ^js (log-manager)))
|
||||
|
||||
(defn init-status-go-logging
|
||||
[{:keys [enable? mobile-system? log-level callback]}]
|
||||
(.initLogging ^js (log-manager) enable? mobile-system? log-level callback))
|
||||
[{:keys [enable? mobile-system? log-level log-request-go? callback]}]
|
||||
(.initLogging ^js (log-manager) enable? mobile-system? log-level log-request-go? callback))
|
||||
|
||||
(defn get-random-mnemonic
|
||||
[callback]
|
||||
|
||||
@@ -81,12 +81,20 @@
|
||||
:unread-mentions-count unread-mentions-count
|
||||
:unread-messages? unread-messages?}])]]]]))
|
||||
|
||||
(defn- title-color
|
||||
[unread-messages? muted theme]
|
||||
(cond
|
||||
muted (colors/theme-colors colors/neutral-40 colors/neutral-60 theme)
|
||||
unread-messages? (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:else (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)))
|
||||
|
||||
(defn communities-membership-list-item
|
||||
[{:keys [customization-color] :as props}
|
||||
bottom-sheet?
|
||||
{:keys [name muted unviewed-messages-count unviewed-mentions-count status
|
||||
images tokens locked? style]}]
|
||||
(let [theme (quo.theme/use-theme)]
|
||||
(let [theme (quo.theme/use-theme)
|
||||
unread-messages? (pos? unviewed-messages-count)]
|
||||
[rn/touchable-highlight
|
||||
(merge {:underlay-color (colors/theme-colors
|
||||
colors/neutral-5
|
||||
@@ -108,11 +116,7 @@
|
||||
:ellipsize-mode :tail
|
||||
:weight :semi-bold
|
||||
:size :paragraph-1
|
||||
:style (when muted
|
||||
{:color (colors/theme-colors
|
||||
colors/neutral-40
|
||||
colors/neutral-60
|
||||
theme)})}
|
||||
:style {:color (title-color unread-messages? muted theme)}}
|
||||
name]]
|
||||
|
||||
[rn/view
|
||||
@@ -128,4 +132,4 @@
|
||||
:customization-color customization-color
|
||||
:muted? muted
|
||||
:unread-mentions-count unviewed-mentions-count
|
||||
:unread-messages? (pos? unviewed-messages-count)}])]]]))
|
||||
:unread-messages? unread-messages?}])]]]))
|
||||
|
||||
@@ -46,11 +46,14 @@
|
||||
(let [theme (quo.theme/use-theme)]
|
||||
[rn/view {:style (style/container container-style)}
|
||||
[rn/view {:style style/index}
|
||||
(if (= type :step)
|
||||
(case type
|
||||
:step
|
||||
[step/view
|
||||
{:in-blur-view? blur?
|
||||
:customization-color customization-color
|
||||
:type (if customization-color :complete :neutral)} step-number]
|
||||
:lock
|
||||
[icon/icon :i/locked {:color (get-colors theme blur?)}]
|
||||
[icon/icon :i/bullet {:color (get-colors theme blur?)}])]
|
||||
[rn/view {:style style/text-container}
|
||||
(when title
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
(def container
|
||||
{:padding-horizontal 12
|
||||
:padding-top 12
|
||||
:padding-bottom 14
|
||||
:flex-direction :row
|
||||
:justify-content :space-between})
|
||||
:padding-bottom 14})
|
||||
|
||||
(defn left-sub-container
|
||||
[{:keys [tag description]}]
|
||||
|
||||
@@ -108,20 +108,25 @@
|
||||
nil)])
|
||||
|
||||
(defn view
|
||||
[{:keys [title on-press action-props accessibility-label blur? container-style] :as props}]
|
||||
[{:keys [title on-press action-props accessibility-label blur? container-style content] :as props}]
|
||||
[rn/pressable
|
||||
{:style (merge style/container container-style)
|
||||
:on-press (or on-press (:on-change action-props))
|
||||
:accessibility-label accessibility-label}
|
||||
[rn/view {:style (style/left-sub-container props)}
|
||||
[image-component props]
|
||||
[rn/view {:style (style/left-container (:image props))}
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:style {:color (when blur? colors/white)}}
|
||||
title]
|
||||
[description-component props]
|
||||
[tag-component props]]]
|
||||
[rn/view {:style (style/sub-container (:alignment action-props))}
|
||||
[label-component props]
|
||||
[action-component props]]])
|
||||
[rn/view
|
||||
{:style {:flex-direction :row
|
||||
:justify-content :space-between}}
|
||||
[rn/view {:style (style/left-sub-container props)}
|
||||
[image-component props]
|
||||
[rn/view {:style (style/left-container (:image props))}
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:style {:color (when blur? colors/white)}}
|
||||
title]
|
||||
[description-component props]
|
||||
[tag-component props]]]
|
||||
[rn/view {:style (style/sub-container (:alignment action-props))}
|
||||
[label-component props]
|
||||
[action-component props]]]
|
||||
(when content
|
||||
content)])
|
||||
|
||||
@@ -14,7 +14,11 @@
|
||||
[state]
|
||||
(:value state))
|
||||
|
||||
(defn numeric-value
|
||||
(defn value-numeric
|
||||
[state]
|
||||
(or (parse-double (input-value state)) 0))
|
||||
|
||||
(defn value-bn
|
||||
[state]
|
||||
(money/bignumber (input-value state)))
|
||||
|
||||
@@ -27,28 +31,32 @@
|
||||
(assoc state :error? error?))
|
||||
|
||||
(defn upper-limit
|
||||
[state]
|
||||
(:upper-limit state))
|
||||
|
||||
(defn upper-limit-bn
|
||||
[state]
|
||||
(money/bignumber (:upper-limit state)))
|
||||
|
||||
(defn lower-limit
|
||||
[state]
|
||||
(:lower-limit state))
|
||||
|
||||
(defn lower-limit-bn
|
||||
[state]
|
||||
(money/bignumber (:lower-limit state)))
|
||||
|
||||
(defn upper-limit-exceeded?
|
||||
[state]
|
||||
(let [num-value (numeric-value state)]
|
||||
(and
|
||||
(upper-limit state)
|
||||
(when (money/bignumber? num-value)
|
||||
(money/greater-than (numeric-value state) (upper-limit state))))))
|
||||
(and (upper-limit state)
|
||||
(when (money/bignumber? (value-bn state))
|
||||
(money/greater-than (value-bn state) (upper-limit-bn state)))))
|
||||
|
||||
(defn- lower-limit-exceeded?
|
||||
[state]
|
||||
(let [num-value (numeric-value state)]
|
||||
(and
|
||||
(lower-limit state)
|
||||
(when (money/bignumber? num-value)
|
||||
(money/less-than (numeric-value state) (lower-limit state))))))
|
||||
(and (lower-limit state)
|
||||
(when (money/bignumber? (value-bn state))
|
||||
(money/less-than (value-bn state) (lower-limit-bn state)))))
|
||||
|
||||
(defn- recheck-errorness
|
||||
[state]
|
||||
@@ -62,7 +70,7 @@
|
||||
(assoc :value value)
|
||||
recheck-errorness))
|
||||
|
||||
(defn set-numeric-value
|
||||
(defn set-value-numeric
|
||||
[state value]
|
||||
(set-input-value state (str value)))
|
||||
|
||||
@@ -81,11 +89,11 @@
|
||||
|
||||
(defn increase
|
||||
[state]
|
||||
(set-input-value state (str (money/add (numeric-value state) 1))))
|
||||
(set-input-value state (str (money/add (value-bn state) 1))))
|
||||
|
||||
(defn decrease
|
||||
[state]
|
||||
(set-input-value state (str (money/add (numeric-value state) -1))))
|
||||
(set-input-value state (str (money/add (value-bn state) -1))))
|
||||
|
||||
(def ^:private not-digits-or-dot-pattern
|
||||
#"[^0-9+\.]")
|
||||
@@ -122,10 +130,12 @@
|
||||
state))
|
||||
|
||||
(defn delete-last
|
||||
[state]
|
||||
(let [value (input-value state)
|
||||
new-value (subs value 0 (dec (count value)))]
|
||||
(set-input-value state new-value)))
|
||||
([state]
|
||||
(delete-last state ""))
|
||||
([state default-value]
|
||||
(let [value (input-value state)
|
||||
new-value (subs value 0 (dec (count value)))]
|
||||
(set-input-value state (if (string/blank? new-value) default-value new-value)))))
|
||||
|
||||
(defn delete-all
|
||||
[state]
|
||||
@@ -133,7 +143,7 @@
|
||||
|
||||
(defn empty-value?
|
||||
[state]
|
||||
(string/blank? (:value state)))
|
||||
(or (string/blank? (:value state)) (<= (value-numeric state) 0)))
|
||||
|
||||
(defn- fiat->crypto
|
||||
[value conversion-rate]
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
[clojure.string :as string]
|
||||
[native-module.core :as native-module]
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.config :as config]
|
||||
[taoensso.timbre :as log]
|
||||
[utils.transforms :as transforms]))
|
||||
|
||||
@@ -24,10 +25,11 @@
|
||||
(let [{:keys [error]} (transforms/json->clj res)]
|
||||
(when-not (string/blank? error)
|
||||
(log/error "init statusgo logging failed" error))))
|
||||
logging-params {:enable? true
|
||||
:mobile-system? false
|
||||
:log-level level
|
||||
:callback handle-error}]
|
||||
logging-params {:enable? true
|
||||
:mobile-system? false
|
||||
:log-level level
|
||||
:log-request-go? config/log-request-go
|
||||
:callback handle-error}]
|
||||
(log/merge-config! {:ns-filter {:allow #{"*"} :deny #{"taoensso.sente"}}})
|
||||
(if (string/blank? level)
|
||||
(native-module/init-status-go-logging (merge logging-params {:log-level "WARN"}))
|
||||
|
||||
@@ -17,14 +17,16 @@
|
||||
[]
|
||||
(rf/dispatch [:hide-bottom-sheet]))
|
||||
|
||||
(defn- toggle-metrics
|
||||
[enabled?]
|
||||
(rf/dispatch [:centralized-metrics/toggle-centralized-metrics enabled?]))
|
||||
(def ^:private will-receive-for-current-points
|
||||
[:t/number-of-messages-sent
|
||||
:t/connected-peers
|
||||
:t/successful-messages-rate
|
||||
:t/connection-type
|
||||
:t/os-app-version-bandwidth])
|
||||
|
||||
(def ^:private will-receive-points
|
||||
[:t/ip-address
|
||||
:t/universally-unique-identifiers-of-device
|
||||
:t/logs-of-actions-withing-the-app])
|
||||
(def ^:private will-receive-for-all-points
|
||||
[:t/action-logs
|
||||
:t/ip-addresses-uuid])
|
||||
|
||||
(def ^:private not-receive-points
|
||||
[:t/your-profile-information
|
||||
@@ -32,7 +34,7 @@
|
||||
:t/information-you-input-and-send])
|
||||
|
||||
(defn- bullet-points
|
||||
[{:keys [title points]}]
|
||||
[{:keys [title points lock?]}]
|
||||
[rn/view
|
||||
[quo/text {:weight :semi-bold}
|
||||
title]
|
||||
@@ -41,37 +43,36 @@
|
||||
[quo/markdown-list
|
||||
{:description (i18n/label label)
|
||||
:blur? true
|
||||
:type (when lock? :lock)
|
||||
:container-style style/item-text}])])
|
||||
|
||||
(defn- on-share-usage
|
||||
[]
|
||||
(toggle-metrics true)
|
||||
(rf/dispatch [:centralized-metrics/toggle-centralized-metrics true true])
|
||||
(hide-bottom-sheet))
|
||||
|
||||
(defn- on-do-not-share
|
||||
[]
|
||||
(toggle-metrics false)
|
||||
(rf/dispatch [:centralized-metrics/toggle-centralized-metrics false true])
|
||||
(hide-bottom-sheet))
|
||||
|
||||
(declare view)
|
||||
|
||||
(defn- on-privacy-policy-press
|
||||
[settings?]
|
||||
[]
|
||||
(rf/dispatch
|
||||
[:show-bottom-sheet
|
||||
{:content (fn []
|
||||
[quo.theme/provider :dark
|
||||
[privacy/privacy-statement]])
|
||||
{:content privacy/privacy-statement
|
||||
:on-close (fn []
|
||||
(rf/dispatch [:show-bottom-sheet
|
||||
{:content (fn []
|
||||
[quo.theme/provider :dark
|
||||
[view {:settings? settings?}]])
|
||||
{:content view
|
||||
:theme :dark
|
||||
:shell? true}]))
|
||||
:theme :dark
|
||||
:shell? true}]))
|
||||
|
||||
(defn- privacy-policy-text
|
||||
[settings?]
|
||||
[]
|
||||
[rn/view {:style style/privacy-policy}
|
||||
[quo/text
|
||||
[quo/text
|
||||
@@ -81,39 +82,38 @@
|
||||
[quo/text
|
||||
{:size :paragraph-2
|
||||
:weight :bold
|
||||
:on-press #(on-privacy-policy-press settings?)}
|
||||
:on-press on-privacy-policy-press}
|
||||
(i18n/label :t/more-details-in-privacy-policy-2)]]])
|
||||
|
||||
(defn view
|
||||
[{:keys [settings?]}]
|
||||
[]
|
||||
(rn/use-mount #(dismiss-keyboard))
|
||||
[:<>
|
||||
[quo/drawer-top
|
||||
{:title (i18n/label :t/help-us-improve-status)
|
||||
:description (i18n/label :t/collecting-usage-data)}]
|
||||
[rn/view {:style style/points-wrapper}
|
||||
[bullet-points
|
||||
{:title (i18n/label :t/what-we-will-receive)
|
||||
:points will-receive-points}]
|
||||
[bullet-points
|
||||
{:title (i18n/label :t/what-we-wont-receive)
|
||||
:points not-receive-points}]
|
||||
(if settings?
|
||||
[quo/text
|
||||
{:size :paragraph-2
|
||||
:style style/info-text}
|
||||
(i18n/label :t/usage-data-shared-from-all-profiles)]
|
||||
[quo/text
|
||||
{:size :paragraph-2
|
||||
:style style/info-text}
|
||||
(i18n/label :t/usage-data-shared-from-all-profiles)
|
||||
(i18n/label :t/sharing-usage-data-can-be-turned-off)])]
|
||||
[rn/scroll-view
|
||||
[rn/view {:style style/points-wrapper}
|
||||
[bullet-points
|
||||
{:title (i18n/label :t/we-will-receive-from-all-profiles)
|
||||
:points will-receive-for-all-points}]
|
||||
[bullet-points
|
||||
{:title (i18n/label :t/we-will-receive-from-the-current-profile)
|
||||
:points will-receive-for-current-points}]
|
||||
[bullet-points
|
||||
{:title (i18n/label :t/what-we-wont-receive)
|
||||
:points not-receive-points
|
||||
:lock? true}]
|
||||
[quo/text
|
||||
{:size :paragraph-2
|
||||
:style style/info-text}
|
||||
(i18n/label :t/sharing-usage-data-can-be-turned-off)]]]
|
||||
[quo/bottom-actions
|
||||
{:actions :two-actions
|
||||
:blur? true
|
||||
:button-one-label (i18n/label :t/share-usage-data)
|
||||
:button-one-label (i18n/label :t/help-us-improve-status)
|
||||
:button-one-props {:on-press on-share-usage}
|
||||
:button-two-label (i18n/label :t/not-now)
|
||||
:button-two-props {:type :grey
|
||||
:on-press on-do-not-share}}]
|
||||
[privacy-policy-text settings?]])
|
||||
[privacy-policy-text]])
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
|
||||
;; CONFIG VALUES
|
||||
(def log-level (string/upper-case (get-config :LOG_LEVEL "")))
|
||||
(def log-request-go (enabled? (get-config :LOG_REQUEST_GO "0")))
|
||||
(def fleet (get-config :FLEET ""))
|
||||
(def apn-topic (get-config :APN_TOPIC "im.status.ethereum"))
|
||||
(def default-network (get-config :DEFAULT_NETWORK "goerli_rpc"))
|
||||
|
||||
@@ -7,17 +7,10 @@
|
||||
[taoensso.timbre :as log]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(def ^:const user-confirmed-key :centralized-metrics/user-confirmed?)
|
||||
(def ^:const enabled-key :centralized-metrics/enabled?)
|
||||
|
||||
(defn show-confirmation-modal?
|
||||
[db]
|
||||
(not (user-confirmed-key db)))
|
||||
|
||||
(defn push-event?
|
||||
[db]
|
||||
(or (not (user-confirmed-key db))
|
||||
(enabled-key db)))
|
||||
(or (not (:centralized-metrics/user-confirmed? db))
|
||||
(:centralized-metrics/enabled? db)))
|
||||
|
||||
(defn centralized-metrics-interceptor
|
||||
[context]
|
||||
@@ -33,17 +26,16 @@
|
||||
:after centralized-metrics-interceptor))
|
||||
|
||||
(rf/reg-event-fx :centralized-metrics/toggle-centralized-metrics
|
||||
(fn [{:keys [db]} [enabled?]]
|
||||
(fn [{:keys [db]} [enabled? onboarding?]]
|
||||
{:fx [[:effects.centralized-metrics/toggle-metrics enabled?]]
|
||||
:db (assoc db
|
||||
user-confirmed-key
|
||||
true
|
||||
enabled-key
|
||||
enabled?)}))
|
||||
:db (-> db
|
||||
(assoc :centralized-metrics/user-confirmed? true)
|
||||
(assoc :centralized-metrics/enabled? enabled?)
|
||||
(assoc :centralized-metrics/onboarding-enabled? (and onboarding? enabled?)))}))
|
||||
|
||||
(rf/reg-event-fx :centralized-metrics/check-modal
|
||||
(fn [{:keys [db]} [modal-view]]
|
||||
(when (show-confirmation-modal? db)
|
||||
(when-not (:centralized-metrics/user-confirmed? db)
|
||||
{:fx [[:dispatch
|
||||
[:show-bottom-sheet
|
||||
{:content (fn [] [modal-view])
|
||||
|
||||
@@ -6,11 +6,6 @@
|
||||
[status-im.contexts.centralized-metrics.tracking :as tracking]
|
||||
[test-helpers.unit :as h]))
|
||||
|
||||
(deftest show-confirmation-modal-test
|
||||
(testing "returns true if the user confirmed"
|
||||
(is (false? (events/show-confirmation-modal? {events/user-confirmed-key true})))
|
||||
(is (true? (events/show-confirmation-modal? {})))))
|
||||
|
||||
(deftest push-event-test
|
||||
(testing "returns correct boolean value"
|
||||
(is (true? (events/push-event? {:centralized-metrics/user-confirmed? false})))
|
||||
|
||||
@@ -146,9 +146,16 @@
|
||||
"")]
|
||||
(subs preview-text 0 (min (count preview-text) max-subheader-length))))
|
||||
|
||||
(defn- last-message-color
|
||||
[unread-messages? muted theme]
|
||||
(cond
|
||||
muted (colors/theme-colors colors/neutral-50 colors/neutral-60 theme)
|
||||
unread-messages? (colors/theme-colors colors/neutral-100 colors/white theme)
|
||||
:else (colors/theme-colors colors/neutral-50 colors/neutral-40 theme)))
|
||||
|
||||
(defn last-message-preview
|
||||
"Render the preview of a last message to a maximum of max-subheader-length characters"
|
||||
[group-chat {:keys [deleted? outgoing from deleted-for-me?] :as message}]
|
||||
[group-chat {:keys [deleted? outgoing from deleted-for-me?] :as message} muted unread-messages?]
|
||||
(let [theme (quo.theme/use-theme)
|
||||
[primary-name _] (rf/sub [:contacts/contact-two-names-by-identity from])
|
||||
preview-text (if deleted-for-me?
|
||||
@@ -162,9 +169,7 @@
|
||||
(preview-text-from-content group-chat primary-name message)))]
|
||||
[quo/text
|
||||
{:size :paragraph-2
|
||||
:style {:color (colors/theme-colors colors/neutral-50
|
||||
colors/neutral-40
|
||||
theme)
|
||||
:style {:color (last-message-color unread-messages? muted theme)
|
||||
:flex 1}
|
||||
:number-of-lines 1
|
||||
:ellipsize-mode :tail
|
||||
@@ -231,14 +236,16 @@
|
||||
unviewed-messages-count]])))
|
||||
|
||||
(defn chat-item
|
||||
[{:keys [chat-id group-chat color name last-message timestamp muted image]
|
||||
[{:keys [chat-id group-chat color name last-message timestamp muted image
|
||||
unviewed-messages-count]
|
||||
:as item}]
|
||||
(let [[primary-name secondary-name]
|
||||
(if group-chat
|
||||
[name ""]
|
||||
(rf/sub [:contacts/contact-two-names-by-identity chat-id]))
|
||||
{:keys [ens-verified added?] :as contact} (when-not group-chat
|
||||
(rf/sub [:contacts/contact-by-address chat-id]))]
|
||||
(rf/sub [:contacts/contact-by-address chat-id]))
|
||||
unread-messages? (pos? unviewed-messages-count)]
|
||||
[rn/view {:style {:flex-direction :row}}
|
||||
[avatar-view
|
||||
{:contact contact
|
||||
@@ -258,7 +265,7 @@
|
||||
:muted? muted
|
||||
:time-str (datetime/to-short-str timestamp)
|
||||
:style {:flex-shrink 1}}]
|
||||
[last-message-preview group-chat last-message muted]]]
|
||||
[last-message-preview group-chat last-message muted unread-messages?]]]
|
||||
[notification item]]))
|
||||
|
||||
(defn chat-user
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
[status-im.contexts.chat.messenger.composer.link-preview.events :as link-preview]
|
||||
[status-im.contexts.chat.messenger.messages.transport.events :as messages.transport]
|
||||
[taoensso.timbre :as log]
|
||||
[utils.debounce :as debounce]
|
||||
[utils.emojilib :as emoji]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]
|
||||
@@ -262,6 +263,8 @@
|
||||
[{{:keys [current-chat-id] :as db} :db :as cofx}]
|
||||
(let [{:keys [input-text metadata]} (get-in db [:chat/inputs current-chat-id])
|
||||
editing-message (:editing-message metadata)]
|
||||
(debounce/clear :link-preview/unfurl-urls)
|
||||
(debounce/clear :mention/on-change-text)
|
||||
(if editing-message
|
||||
(send-edited-message cofx input-text editing-message)
|
||||
(send-messages cofx input-text current-chat-id))))
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
(- window-height
|
||||
(* 2 56) ;; two other list items
|
||||
(* 2 16) ;; spacing between items
|
||||
220) ;; extra spacing (top bar)
|
||||
)
|
||||
220)) ;; extra spacing (top bar)
|
||||
|
||||
|
||||
(defn- create-profile-option-card
|
||||
[window-height]
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
{:key :type
|
||||
:type :select
|
||||
:options [{:key :bullet}
|
||||
{:key :step}]}
|
||||
{:key :step}
|
||||
{:key :lock}]}
|
||||
(preview/customization-color-option)])
|
||||
|
||||
(defn view
|
||||
|
||||
@@ -48,7 +48,8 @@
|
||||
:profile/profile (merge profile-overview
|
||||
settings
|
||||
{:log-level log-level}))
|
||||
(assoc-in [:activity-center :loading?] true))
|
||||
(assoc-in [:activity-center :loading?] true)
|
||||
(dissoc :centralized-metrics/onboarding-enabled?))
|
||||
pairing-completed?
|
||||
(dissoc :syncing))
|
||||
:fx (into [[:json-rpc/call
|
||||
@@ -62,6 +63,9 @@
|
||||
;; loading chats and communities. This globally helps alleviate
|
||||
;; stuttering immediately after login.
|
||||
[:dispatch-later [{:ms 500 :dispatch [:wallet/initialize]}]]
|
||||
;; Fetching the currencies along with wallet initialization as
|
||||
;; we rely on it for displaying currency symbol
|
||||
[:dispatch-later [{:ms 500 :dispatch [:settings/get-currencies]}]]
|
||||
|
||||
[:logs/set-level log-level]
|
||||
|
||||
@@ -69,7 +73,10 @@
|
||||
;; messenger has started and has processed all chats because
|
||||
;; the whole process can take a handful of seconds.
|
||||
(when-not (:universal-links/handling db)
|
||||
[:effects.chat/open-last-chat (:key-uid profile-overview)])]
|
||||
[:effects.chat/open-last-chat (:key-uid profile-overview)])
|
||||
|
||||
(when (:centralized-metrics/onboarding-enabled? db)
|
||||
[:dispatch [:profile.settings/toggle-telemetry true]])]
|
||||
|
||||
(cond
|
||||
pairing-completed?
|
||||
@@ -95,7 +102,6 @@
|
||||
[:dispatch-later [{:ms 1500 :dispatch [:profile.login/non-critical-initialization]}]]
|
||||
[:dispatch [:network/check-expensive-connection]]
|
||||
[:profile.settings/get-profile-picture key-uid]
|
||||
[:settings/get-currencies]
|
||||
(when (ff/enabled? ::ff/wallet.wallet-connect)
|
||||
[:dispatch [:wallet-connect/init]])
|
||||
(when (ff/enabled? ::ff/wallet.swap)
|
||||
|
||||
@@ -87,9 +87,11 @@
|
||||
:on-error #(log/error "failed to toggle peer syncing" new-value %)}]]]})))
|
||||
|
||||
(rf/reg-event-fx :profile.settings/toggle-telemetry
|
||||
(fn [{:keys [db]}]
|
||||
(let [value (get-in db [:profile/profile :telemetry-server-url])
|
||||
new-value (if (string/blank? value) constants/default-telemetry-server-url "")]
|
||||
(fn [{:keys [db]} [enable?]]
|
||||
(let [enable? (if (nil? enable?)
|
||||
(string/blank? (get-in db [:profile/profile :telemetry-server-url]))
|
||||
enable?)
|
||||
new-value (if enable? constants/default-telemetry-server-url "")]
|
||||
{:dispatch [:profile.settings/profile-update :telemetry-server-url new-value]})))
|
||||
|
||||
(rf/reg-event-fx :profile.settings/change-appearance
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
(ns status-im.contexts.settings.language-and-currency.events
|
||||
(:require [status-im.common.json-rpc.events :as json-rpc]
|
||||
[status-im.contexts.settings.language-and-currency.data-store :as data-store]
|
||||
(:require [status-im.contexts.settings.language-and-currency.data-store :as data-store]
|
||||
[utils.collection]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
@@ -11,8 +10,9 @@
|
||||
:currencies
|
||||
(utils.collection/index-by :id all-currencies))})))
|
||||
|
||||
(rf/reg-fx :settings/get-currencies
|
||||
(rf/reg-event-fx :settings/get-currencies
|
||||
(fn []
|
||||
(json-rpc/call {:method "appgeneral_getCurrencies"
|
||||
:on-success [:settings/get-currencies-success]
|
||||
:on-error [:log-rpc-error {:event :settings/get-currencies}]})))
|
||||
{:fx [[:json-rpc/call
|
||||
[{:method "appgeneral_getCurrencies"
|
||||
:on-success [:settings/get-currencies-success]
|
||||
:on-error [:log-rpc-error {:event :settings/get-currencies}]}]]]}))
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
(ns status-im.contexts.settings.privacy-and-security.share-usage.view
|
||||
(:require
|
||||
[quo.core :as quo]
|
||||
[quo.foundations.colors :as colors]
|
||||
[quo.theme]
|
||||
[react-native.core :as rn]
|
||||
[react-native.safe-area :as safe-area]
|
||||
[status-im.common.events-helper :as events-helper]
|
||||
[status-im.common.privacy.view :as privacy]
|
||||
[status-im.contexts.settings.privacy-and-security.style :as privacy-and-security.style]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(def ^:private network-behavior-points
|
||||
[:t/number-of-messages-sent
|
||||
:t/connected-peers
|
||||
:t/successful-messages-rate
|
||||
:t/connection-type
|
||||
:t/os-app-version-bandwidth])
|
||||
|
||||
(def ^:private app-interactions-points
|
||||
[:t/action-logs
|
||||
:t/ip-addresses-uuid])
|
||||
|
||||
(def ^:private not-receive-points
|
||||
[:t/your-profile-information
|
||||
:t/your-addresses
|
||||
:t/information-you-input-and-send])
|
||||
|
||||
(defn- get-category-data
|
||||
[{:keys [title description points on-toggle toggle-checked? lock?]}]
|
||||
{:title title
|
||||
:description (when description :text)
|
||||
:description-props (when description {:text description})
|
||||
:blur? true
|
||||
:action (when on-toggle :selector)
|
||||
:action-props (when on-toggle
|
||||
{:on-change on-toggle
|
||||
:checked? toggle-checked?})
|
||||
:content [rn/view {:style {:margin-top 8}}
|
||||
(for [label points]
|
||||
^{:key label}
|
||||
[quo/markdown-list
|
||||
{:description (i18n/label label)
|
||||
:blur? true
|
||||
:type (when lock? :lock)
|
||||
:container-style {:padding-top 8}}])]})
|
||||
|
||||
(defn- on-privacy-policy-press
|
||||
[]
|
||||
(rf/dispatch
|
||||
[:show-bottom-sheet
|
||||
{:content (fn []
|
||||
[quo.theme/provider :dark
|
||||
[privacy/privacy-statement]])
|
||||
:shell? true}]))
|
||||
|
||||
(defn- privacy-policy-text
|
||||
[]
|
||||
[quo/text {:style {:text-align :center}}
|
||||
[quo/text
|
||||
{:style {:color colors/white-opa-50}
|
||||
:size :paragraph-2}
|
||||
(i18n/label :t/more-details-in-privacy-policy-settings-1)]
|
||||
[quo/text
|
||||
{:size :paragraph-2
|
||||
:on-press on-privacy-policy-press}
|
||||
(i18n/label :t/more-details-in-privacy-policy-2)]])
|
||||
|
||||
(defn view
|
||||
[]
|
||||
(let [insets (safe-area/get-insets)
|
||||
telemetry-enabled? (rf/sub [:profile/telemetry-enabled?])
|
||||
centralized-metrics-enabled? (rf/sub [:centralized-metrics/enabled?])]
|
||||
[quo/overlay
|
||||
{:type :shell
|
||||
:container-style (privacy-and-security.style/page-wrapper (:top insets))}
|
||||
[quo/page-nav
|
||||
{:key :header
|
||||
:background :blur
|
||||
:icon-name :i/arrow-left
|
||||
:on-press events-helper/navigate-back}]
|
||||
[quo/page-top
|
||||
{:title (i18n/label :t/share-usage-data)
|
||||
:title-accessibility-label :title-label
|
||||
:description :text
|
||||
:description-text (i18n/label :t/collecting-usage-data)}]
|
||||
[rn/scroll-view {:style {:flex 1}}
|
||||
[quo/category
|
||||
{:data [(get-category-data
|
||||
{:toggle-checked? telemetry-enabled?
|
||||
:on-toggle #(rf/dispatch [:profile.settings/toggle-telemetry])
|
||||
:title (i18n/label :t/network-behavior)
|
||||
:description (i18n/label :t/will-be-shared-from-the-current-profile)
|
||||
:points network-behavior-points})
|
||||
(get-category-data {:toggle-checked? centralized-metrics-enabled?
|
||||
:on-toggle #(rf/dispatch
|
||||
[:centralized-metrics/toggle-centralized-metrics
|
||||
(not centralized-metrics-enabled?)])
|
||||
:title (i18n/label :t/app-interactions)
|
||||
:description (i18n/label :t/will-be-shared-from-all-profiles)
|
||||
:points app-interactions-points})]
|
||||
:blur? true
|
||||
:list-type :settings}]
|
||||
[quo/category
|
||||
{:data [(get-category-data {:title (i18n/label :t/what-we-wont-receive)
|
||||
:points not-receive-points
|
||||
:lock? true})]
|
||||
:blur? true
|
||||
:list-type :settings}]]
|
||||
[rn/view
|
||||
{:align-items :center
|
||||
:padding-horizontal 20
|
||||
:padding-bottom (:bottom insets)}
|
||||
[privacy-policy-text]]]))
|
||||
@@ -6,7 +6,6 @@
|
||||
[react-native.platform :as platform]
|
||||
[react-native.safe-area :as safe-area]
|
||||
[status-im.common.events-helper :as events-helper]
|
||||
[status-im.common.metrics-confirmation-modal.view :as metrics-modal]
|
||||
[status-im.contexts.settings.privacy-and-security.profile-picture.view :as profile-picture.view]
|
||||
[status-im.contexts.settings.privacy-and-security.style :as style]
|
||||
[status-im.feature-flags :as ff]
|
||||
@@ -25,19 +24,9 @@
|
||||
:id :preview-privacy
|
||||
:customization-color customization-color}})
|
||||
|
||||
(defn- on-share-usage-data-press
|
||||
[]
|
||||
(rf/dispatch
|
||||
[:show-bottom-sheet
|
||||
{:content (fn []
|
||||
[quo.theme/provider :dark
|
||||
[metrics-modal/view {:settings? true}]])
|
||||
:shell? true}]))
|
||||
|
||||
(defn view
|
||||
[]
|
||||
(let [insets (safe-area/get-insets)
|
||||
centralized-metrics-enabled? (rf/sub [:centralized-metrics/enabled?])
|
||||
customization-color (rf/sub [:profile/customization-color])
|
||||
|
||||
preview-privacy? (rf/sub [:profile/preview-privacy?])
|
||||
@@ -95,13 +84,12 @@
|
||||
show-profile-pictures-to
|
||||
open-show-profile-pictures-to-options))
|
||||
(setting-preview-privacy preview-privacy? customization-color toggle-preview-privacy)
|
||||
{:title (i18n/label :t/share-usage-data-with-status)
|
||||
{:title (i18n/label :t/share-usage-data)
|
||||
:description :text
|
||||
:description-props {:text (i18n/label :t/from-all-profiles-on-device)}
|
||||
:blur? true
|
||||
:action :selector
|
||||
:action-props {:on-change on-share-usage-data-press
|
||||
:customization-color customization-color
|
||||
:checked? centralized-metrics-enabled?}}]
|
||||
:action :arrow
|
||||
:action-props {:on-change #(rf/dispatch [:open-modal
|
||||
:screen/settings.share-usage-data])}}]
|
||||
:blur? true
|
||||
:list-type :settings}]]))
|
||||
|
||||
@@ -262,8 +262,8 @@
|
||||
(string/upper-case
|
||||
constants/mainnet-short-name))
|
||||
(money/equal-to
|
||||
(controlled-input/numeric-value input-state)
|
||||
(controlled-input/upper-limit input-state))
|
||||
(controlled-input/value-bn input-state)
|
||||
(controlled-input/upper-limit-bn input-state))
|
||||
(money/equal-to (:total-balance
|
||||
owned-eth-token)
|
||||
0)))
|
||||
@@ -338,10 +338,10 @@
|
||||
{:limit (if crypto-currency?
|
||||
(utils/prettify-crypto-balance
|
||||
(or (clj->js token-symbol) "")
|
||||
(controlled-input/upper-limit input-state)
|
||||
(controlled-input/upper-limit-bn input-state)
|
||||
conversion-rate)
|
||||
(utils/prettify-balance currency-symbol
|
||||
(controlled-input/upper-limit
|
||||
(controlled-input/upper-limit-bn
|
||||
input-state)))})
|
||||
:status (when (controlled-input/input-error input-state) :error)}]}]
|
||||
[routes/view
|
||||
|
||||
@@ -11,25 +11,26 @@
|
||||
|
||||
(defn view
|
||||
[]
|
||||
(let [on-close (rn/use-callback
|
||||
#(rf/dispatch [:wallet/collectible-amount-navigate-back]))
|
||||
send-transaction-data (rf/sub [:wallet/wallet-send])
|
||||
collectible (:collectible send-transaction-data)
|
||||
balance (utils/collectible-balance collectible)
|
||||
[value set-value] (rn/use-state (-> controlled-input/init-state
|
||||
(controlled-input/set-numeric-value 1)
|
||||
(controlled-input/set-lower-limit 1)))
|
||||
preview-uri (get-in collectible [:preview-url :uri])
|
||||
incorrect-value? (controlled-input/input-error value)
|
||||
increase-value (rn/use-callback #(set-value controlled-input/increase))
|
||||
decrease-value (rn/use-callback #(set-value controlled-input/decrease))
|
||||
delete-character (rn/use-callback #(set-value controlled-input/delete-last))
|
||||
add-character (rn/use-callback
|
||||
(fn [c]
|
||||
(set-value #(controlled-input/add-character % c))))]
|
||||
(let [on-close (rn/use-callback
|
||||
#(rf/dispatch [:wallet/collectible-amount-navigate-back]))
|
||||
send-transaction-data (rf/sub [:wallet/wallet-send])
|
||||
collectible (:collectible send-transaction-data)
|
||||
balance (utils/collectible-balance collectible)
|
||||
[input-state set-input-state] (rn/use-state (-> controlled-input/init-state
|
||||
(controlled-input/set-value-numeric 1)
|
||||
(controlled-input/set-lower-limit 1)))
|
||||
preview-uri (get-in collectible [:preview-url :uri])
|
||||
incorrect-value? (controlled-input/input-error input-state)
|
||||
increase-value (rn/use-callback #(set-input-state controlled-input/increase))
|
||||
decrease-value (rn/use-callback #(set-input-state controlled-input/decrease))
|
||||
delete-character (rn/use-callback
|
||||
(fn [] (set-input-state #(controlled-input/delete-last % "1"))))
|
||||
add-character (rn/use-callback
|
||||
(fn [c]
|
||||
(set-input-state #(controlled-input/add-character % c))))]
|
||||
(rn/use-effect
|
||||
(fn []
|
||||
(set-value #(controlled-input/set-upper-limit % balance)))
|
||||
(set-input-state #(controlled-input/set-upper-limit % balance)))
|
||||
[balance])
|
||||
[rn/view
|
||||
[account-switcher/view
|
||||
@@ -47,9 +48,9 @@
|
||||
:status (if incorrect-value? :error :default)
|
||||
:container-style style/network-tags-container}]
|
||||
[quo/amount-input
|
||||
{:max-value (controlled-input/upper-limit value)
|
||||
:min-value (controlled-input/lower-limit value)
|
||||
:value (controlled-input/numeric-value value)
|
||||
{:max-value (controlled-input/upper-limit input-state)
|
||||
:min-value (controlled-input/lower-limit input-state)
|
||||
:value (controlled-input/value-numeric input-state)
|
||||
:on-inc-press increase-value
|
||||
:on-dec-press decrease-value
|
||||
:container-style style/amount-input-container
|
||||
@@ -59,7 +60,7 @@
|
||||
:button-one-props {:on-press #(rf/dispatch
|
||||
[:wallet/set-collectible-amount-to-send
|
||||
{:stack-id :screen/wallet.select-collectible-amount
|
||||
:amount (controlled-input/numeric-value value)}])
|
||||
:amount (controlled-input/value-numeric input-state)}])
|
||||
:disabled? incorrect-value?}
|
||||
:button-one-label (i18n/label :t/confirm)}]
|
||||
[quo/numbered-keyboard
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
approval-amount-required (rf/sub [:wallet/swap-proposal-approval-amount-required])
|
||||
currency-symbol (rf/sub [:profile/currency-symbol])
|
||||
approval-transaction-status (rf/sub [:wallet/swap-approval-transaction-status])
|
||||
pay-input-num-value (controlled-input/numeric-value input-state)
|
||||
pay-input-num-value (controlled-input/value-numeric input-state)
|
||||
pay-input-amount (controlled-input/input-value input-state)
|
||||
pay-token-symbol (:symbol asset-to-pay)
|
||||
pay-token-decimals (:decimals asset-to-pay)
|
||||
@@ -231,7 +231,7 @@
|
||||
network (rf/sub [:wallet/swap-network])
|
||||
pay-input-amount (controlled-input/input-value pay-input-state)
|
||||
pay-token-decimals (:decimals asset-to-pay)
|
||||
pay-input-num-value (controlled-input/numeric-value pay-input-state)
|
||||
pay-input-num-value (controlled-input/value-numeric pay-input-state)
|
||||
pay-token-balance-selected-chain (get-in asset-to-pay
|
||||
[:balances-per-chain
|
||||
(:chain-id network) :balance]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
(ns status-im.contexts.wallet.wallet-connect.events.session-proposals
|
||||
(:require [re-frame.core :as rf]
|
||||
(:require [clojure.string :as string]
|
||||
[re-frame.core :as rf]
|
||||
[react-native.wallet-connect :as wallet-connect]
|
||||
[status-im.contexts.wallet.wallet-connect.utils.data-store :as
|
||||
data-store]
|
||||
@@ -59,21 +60,30 @@
|
||||
:wallet-connect/on-session-proposal
|
||||
(fn [{:keys [db]} [proposal]]
|
||||
(log/info "Received Wallet Connect session proposal: " proposal)
|
||||
(let [accounts (get-in db [:wallet :accounts])
|
||||
current-viewing-address (get-in db [:wallet :current-viewing-account-address])
|
||||
available-accounts (sessions/filter-operable-accounts (vals accounts))
|
||||
networks (networks/get-networks-by-mode db)
|
||||
session-networks (networks/proposal-networks-intersection proposal networks)
|
||||
required-networks-supported? (networks/required-networks-supported? proposal networks)]
|
||||
(let [accounts (get-in db [:wallet :accounts])
|
||||
current-viewing-address (get-in db [:wallet :current-viewing-account-address])
|
||||
sessions (get db :wallet-connect/sessions)
|
||||
available-accounts (sessions/filter-operable-accounts (vals accounts))
|
||||
latest-connected-account-address (sessions/latest-connected-account-address sessions)
|
||||
networks (networks/get-networks-by-mode db)
|
||||
session-networks (networks/proposal-networks-intersection proposal networks)
|
||||
required-networks-supported? (networks/required-networks-supported? proposal networks)]
|
||||
(if (and (not-empty session-networks) required-networks-supported?)
|
||||
{:db (update db
|
||||
:wallet-connect/current-proposal assoc
|
||||
:request proposal
|
||||
:session-networks session-networks
|
||||
:address (or current-viewing-address
|
||||
(-> available-accounts
|
||||
first
|
||||
:address)))
|
||||
:address (cond
|
||||
(not (string/blank? current-viewing-address))
|
||||
current-viewing-address
|
||||
|
||||
(not (string/blank?
|
||||
latest-connected-account-address))
|
||||
latest-connected-account-address
|
||||
|
||||
:else (-> available-accounts
|
||||
first
|
||||
:address)))
|
||||
:fx [[:dispatch [:open-modal :screen/wallet.wallet-connect-session-proposal]]]}
|
||||
{:fx [[:dispatch [:wallet-connect/show-session-networks-unsupported-toast proposal]]
|
||||
[:dispatch [:wallet-connect/reject-session-proposal proposal]]]}))))
|
||||
|
||||
@@ -31,3 +31,14 @@
|
||||
account-addresses))
|
||||
accounts))
|
||||
sessions))
|
||||
|
||||
(defn latest-connected-account-address
|
||||
[sessions]
|
||||
(let [all-accounts (->> sessions
|
||||
(sort-by :expiry >)
|
||||
first
|
||||
:accounts)]
|
||||
(-> all-accounts
|
||||
first
|
||||
(string/split #":")
|
||||
last)))
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
;; feature and we want both clients in sync. We keep the code because it
|
||||
;; works and we may re-enable it by default.
|
||||
::profile-pictures-visibility (enabled-in-env? :FLAG_PROFILE_PICTURES_VISIBILITY_ENABLED)
|
||||
|
||||
::settings.telemetry (enabled-in-env? :FLAG_TELEMETRY_ENABLED)
|
||||
::settings.import-all-keypairs (enabled-in-env?
|
||||
:FLAG_WALLET_SETTINGS_IMPORT_ALL_KEYPAIRS)
|
||||
::shell.jump-to (enabled-in-env? :ENABLE_JUMP_TO)
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
[status-im.contexts.profile.settings.view :as settings]
|
||||
[status-im.contexts.settings.language-and-currency.currency.view :as settings.currency-selection]
|
||||
[status-im.contexts.settings.language-and-currency.view :as settings.language-and-currency]
|
||||
[status-im.contexts.settings.privacy-and-security.share-usage.view :as settings.share-usage]
|
||||
[status-im.contexts.settings.privacy-and-security.view :as settings.privacy-and-security]
|
||||
[status-im.contexts.settings.wallet.keypairs-and-accounts.missing-keypairs.encrypted-qr.view
|
||||
:as encrypted-keypair-qr]
|
||||
@@ -646,6 +647,10 @@
|
||||
:options options/transparent-modal-screen-options
|
||||
:component settings.privacy-and-security/view}
|
||||
|
||||
{:name :screen/settings.share-usage-data
|
||||
:options options/transparent-modal-screen-options
|
||||
:component settings.share-usage/view}
|
||||
|
||||
{:name :screen/settings.language-and-currency
|
||||
:options options/transparent-modal-screen-options
|
||||
:component settings.language-and-currency/view}
|
||||
|
||||
@@ -115,12 +115,13 @@
|
||||
{:logFileDirectory
|
||||
(fn [] (str test-dir "/log"))
|
||||
:initLogging
|
||||
(fn [enabled mobile-system log-level callback]
|
||||
(fn [enabled mobile-system log-level log-request-go? callback]
|
||||
(callback (.initLogging native-status
|
||||
(types/clj->json {:Enabled enabled
|
||||
:MobileSystem mobile-system
|
||||
:Level log-level
|
||||
:File (str test-dir "/geth.log")}))))}))
|
||||
(types/clj->json {:Enabled enabled
|
||||
:MobileSystem mobile-system
|
||||
:Level log-level
|
||||
:LogRequestGo log-request-go?
|
||||
:LogRequestFile (str test-dir "/request.log")}))))}))
|
||||
|
||||
(def network
|
||||
(clj->js
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
|
||||
"owner": "status-im",
|
||||
"repo": "status-go",
|
||||
"version": "900ad9be01de8bfce2c229c8fb0222b99606cf35",
|
||||
"commit-sha1": "900ad9be01de8bfce2c229c8fb0222b99606cf35",
|
||||
"src-sha256": "0axamynhkg4m4hcgdznz62lz0hvalb7rw0axziy6hvjxj2i9b3r4"
|
||||
"version": "f859b58c3896523b2fb9a09b3e5c1cedb04f959b",
|
||||
"commit-sha1": "f859b58c3896523b2fb9a09b3e5c1cedb04f959b",
|
||||
"src-sha256": "009nd47aajng5k7wrcqv5zvvzniaswqi706fpkbbjhqziympi1s1"
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
"account-title": "Account",
|
||||
"accounts": "Accounts",
|
||||
"accounts-count": "{{count}} accounts",
|
||||
"action-logs": "Logs of actions, including button presses and screen visits",
|
||||
"actions": "Actions",
|
||||
"active-members": "Active members",
|
||||
"active-online": "Online",
|
||||
@@ -131,6 +132,7 @@
|
||||
"anyone": "Anyone",
|
||||
"app-commit": "App commit",
|
||||
"app-connections": "App connections",
|
||||
"app-interactions": "App interactions",
|
||||
"appearance": "Appearance",
|
||||
"apply": "Apply",
|
||||
"apply-changes": "Apply changes",
|
||||
@@ -466,11 +468,13 @@
|
||||
"connect-with-users": "Connect with users",
|
||||
"connected": "Connected",
|
||||
"connected-dapps": "Connected dApps",
|
||||
"connected-peers": "Connected and discovered peers",
|
||||
"connected-to": "Connected to",
|
||||
"connecting": "Connecting...",
|
||||
"connecting-requires-login": "Connecting to another network requires login",
|
||||
"connection-request": "Connection Request",
|
||||
"connection-status": "Connection status",
|
||||
"connection-type": "Type of connection to peers",
|
||||
"connection-with-the-card-lost": "Connection with the card\n has been lost",
|
||||
"connection-with-the-card-lost-setup-text": "To resume the setup hold the card to\n the back of your phone and maintain\n card to phone contact",
|
||||
"connection-with-the-card-lost-text": "To proceed hold the card to the back of your phone",
|
||||
@@ -1260,6 +1264,7 @@
|
||||
"invite-warning": "This promotion is only valid for users of an Android device, who aren't residents of US. Friend needs to confirm referral within 7 days",
|
||||
"invited": "invited",
|
||||
"ip-address": "IP address",
|
||||
"ip-addresses-uuid": "IP addresses and UUID",
|
||||
"italic": "Italic",
|
||||
"jan": "Jan",
|
||||
"join": "Join",
|
||||
@@ -1579,6 +1584,7 @@
|
||||
"more": "more",
|
||||
"more-details-in-privacy-policy-1": "For more details refer to our ",
|
||||
"more-details-in-privacy-policy-2": "Privacy Policy",
|
||||
"more-details-in-privacy-policy-settings-1": "For details on this and other potential limited data processing by Status, see our ",
|
||||
"move-and-reset": "Move and Reset",
|
||||
"move-keystore-file": "Move keystore file",
|
||||
"move-keystore-file-to-keycard": "Move keystore file to keycard?",
|
||||
@@ -1624,6 +1630,7 @@
|
||||
"need-help": "Need help?",
|
||||
"negative": "Negative",
|
||||
"network": "Network",
|
||||
"network-behavior": "Network behavior",
|
||||
"network-chain": "Network chain",
|
||||
"network-fee": "Network fee",
|
||||
"network-id": "Network ID",
|
||||
@@ -1742,6 +1749,7 @@
|
||||
"notify": "Notify",
|
||||
"nov": "Nov",
|
||||
"now": "Now",
|
||||
"number-of-messages-sent": "Number of messages sent to you",
|
||||
"oct": "Oct",
|
||||
"off": "Off",
|
||||
"off-status-tree": "Off Status tree",
|
||||
@@ -1800,6 +1808,7 @@
|
||||
"origin": "Origin",
|
||||
"origin-desc": "Origin is where your key pair (your private and public key) comes from. You can generate a new key pair or import an existing private key.",
|
||||
"origin-header": "Origin",
|
||||
"os-app-version-bandwidth": "OS, app version and bandwidth usage",
|
||||
"outgoing": "Outgoing",
|
||||
"outgoing-transaction": "Outgoing transaction",
|
||||
"overview": "Overview",
|
||||
@@ -2363,6 +2372,7 @@
|
||||
"submit-bug": "Submit a bug",
|
||||
"success": "Success",
|
||||
"successful-connection": "Successful Connection",
|
||||
"successful-messages-rate": "Rate of successfully sent messages",
|
||||
"suggested-min-tip": "Suggested min. tip",
|
||||
"suggested-price-limit": "Suggested price limit",
|
||||
"sun": "Sun",
|
||||
@@ -2713,6 +2723,8 @@
|
||||
"wc-how-to-use-status-app": "How to use the Status app including privacy and security",
|
||||
"wc-new-tos-based-on-principles-prefix": "New Terms of Use designed based on our",
|
||||
"we": "We",
|
||||
"we-will-receive-from-all-profiles": "We will receive from all profiles:",
|
||||
"we-will-receive-from-the-current-profile": "We will receive from the current profile:",
|
||||
"web-view-error": "Unable to load page",
|
||||
"websites": "Websites",
|
||||
"webview-camera-permission-requests": "Webview camera permission requests",
|
||||
@@ -2738,6 +2750,8 @@
|
||||
"who-are-you-looking-for": "Who are you looking for ?",
|
||||
"wifi-and-mobile-data": "Wi-Fi and mobile data",
|
||||
"wifi-only": "Wi-Fi only",
|
||||
"will-be-shared-from-all-profiles": "Will be shared from all profiles on device",
|
||||
"will-be-shared-from-the-current-profile": "Will be shared from the current profile",
|
||||
"with-full-encryption": "With full metadata privacy and e2e encryption",
|
||||
"word-count": "Word count",
|
||||
"word-n": "Word #{{number}}",
|
||||
|
||||
Reference in New Issue
Block a user