Skip to content

Commit c5b78d8

Browse files
authored
Merge pull request #5838 from EdgeApp/matthew/high-precision-arrr-sync
Show more precision for ARRR sync ratio
2 parents 60539ae + fd0dd61 commit c5b78d8

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

eslint.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ export default [
336336

337337
'src/components/text/TitleText.tsx',
338338
'src/components/themed/Alert.tsx',
339-
'src/components/themed/BuyCrypto.tsx',
339+
340340
'src/components/themed/CreateWalletSelectCryptoRow.tsx',
341341
'src/components/themed/DividerLine.tsx',
342342
'src/components/themed/EdgeProviderComponent.tsx',
@@ -395,7 +395,7 @@ export default [
395395
'src/components/tiles/LtvRatioTile.tsx',
396396
'src/components/tiles/PercentageChangeArrowTile.tsx',
397397
'src/components/tiles/TotalDebtCollateralTile.tsx',
398-
'src/constants/WalletAndCurrencyConstants.ts',
398+
399399
'src/controllers/action-queue/ActionQueueStore.ts',
400400
'src/controllers/action-queue/cleaners.ts',
401401
'src/controllers/action-queue/push.ts',

src/components/themed/BuyCrypto.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ export const BuyCrypto: React.FC<Props> = (props: Props) => {
5555
})
5656

5757
const { displayName, pluginId } = wallet.currencyInfo
58+
const { highPrecisionSyncRatioDisplay = false } =
59+
SPECIAL_CURRENCY_INFO[pluginId]
60+
const syncRatioPrecisionOpts = highPrecisionSyncRatioDisplay
61+
? {
62+
minPrecision: 5,
63+
maxPrecision: 5
64+
}
65+
: undefined
5866

5967
return (
6068
<>
@@ -87,7 +95,7 @@ export const BuyCrypto: React.FC<Props> = (props: Props) => {
8795
<EdgeText style={styles.transactionsLoadingText}>
8896
{sprintf(
8997
lstrings.percent_complete_1s,
90-
toPercentString(syncRatio)
98+
toPercentString(syncRatio, syncRatioPrecisionOpts)
9199
)}
92100
</EdgeText>
93101
</>

src/constants/WalletAndCurrencyConstants.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ interface SpecialCurrencyInfo {
167167
noChangeMiningFee?: boolean
168168
noMaxSpend?: boolean
169169
keysOnlyMode?: boolean
170+
highPrecisionSyncRatioDisplay?: boolean
170171
/**
171172
* This disables the transaction list for the wallet.
172173
* (Default: false)
@@ -200,7 +201,7 @@ interface SpecialCurrencyInfo {
200201
export const getSpecialCurrencyInfo = (
201202
pluginId: string
202203
): SpecialCurrencyInfo => {
203-
if (SPECIAL_CURRENCY_INFO[pluginId]) {
204+
if (SPECIAL_CURRENCY_INFO[pluginId] !== undefined) {
204205
return SPECIAL_CURRENCY_INFO[pluginId]
205206
} else {
206207
return {
@@ -832,6 +833,7 @@ export const SPECIAL_CURRENCY_INFO: Record<string, SpecialCurrencyInfo> = {
832833
noChangeMiningFee: true,
833834
isImportKeySupported: true,
834835
keysOnlyMode: Platform.OS === 'android' && Platform.constants.Version < 28,
836+
highPrecisionSyncRatioDisplay: true,
835837
importKeyOptions: [
836838
{
837839
optionName: 'birthdayHeight',
@@ -973,7 +975,7 @@ export const USD_FIAT = 'iso:USD'
973975
/**
974976
* Get the fiat symbol from an iso:[fiat] OR fiat currency code
975977
*/
976-
export const getFiatSymbol = (isoOrFiatCurrencyCode: string) => {
978+
export const getFiatSymbol = (isoOrFiatCurrencyCode: string): string => {
977979
if (typeof isoOrFiatCurrencyCode !== 'string') return ''
978980
const codeWithoutIso = removeIsoPrefix(isoOrFiatCurrencyCode)
979981
const out = FIAT_CODES_SYMBOLS[codeWithoutIso.toUpperCase()]

0 commit comments

Comments
 (0)