Skip to content

Commit bf48730

Browse files
committed
Add high precision syncRatio display for Piratechain
Old wallets can take a long time to load. Showing more precision will show that the synchronizer is still working
1 parent b252a06 commit bf48730

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

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: 2 additions & 0 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)
@@ -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',

0 commit comments

Comments
 (0)