Updated on 2026-08-14
This commit is contained in:
parent
61eabc7864
commit
c6ca6b009d
1 changed files with 16 additions and 5 deletions
|
|
@ -107,12 +107,9 @@ class CurrenciesRepository(val context: Application) {
|
|||
}
|
||||
return try {
|
||||
val json = context.readFileText(getFileNameForBlockchains(cardId))
|
||||
blockchainNetworkAdapter.fromJson(json)?.distinct() ?: loadSavedCurrenciesOldWay(
|
||||
cardId,
|
||||
derivationStyle
|
||||
)
|
||||
blockchainNetworkAdapter.fromJson(json)?.distinct() ?: emptyList()
|
||||
} catch (exception: Exception) {
|
||||
emptyList()
|
||||
tryToLoadPreviousFormatAndMigrate(cardId, derivationStyle)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -126,6 +123,20 @@ class CurrenciesRepository(val context: Application) {
|
|||
}
|
||||
}
|
||||
|
||||
private fun tryToLoadPreviousFormatAndMigrate(
|
||||
cardId: String,
|
||||
derivationStyle: DerivationStyle?
|
||||
): List<BlockchainNetwork> {
|
||||
return try {
|
||||
loadSavedCurrenciesOldWay(
|
||||
cardId,
|
||||
derivationStyle
|
||||
)
|
||||
} catch (exception: Exception) {
|
||||
emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
private fun loadSavedCurrenciesOldWay(
|
||||
cardId: String, derivationStyle: DerivationStyle?
|
||||
): List<BlockchainNetwork> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue