Skip to content

Commit fe8473e

Browse files
authored
Merge pull request #805 from soramitsu/merge/staging-to-master
merge/staging-to-master
2 parents 2ae3b2a + 14fe2f8 commit fe8473e

File tree

5 files changed

+9
-24
lines changed

5 files changed

+9
-24
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ buildscript {
22
ext {
33
// App version
44
versionName = '2.1.0'
5-
versionCode = 81
5+
versionCode = 82
66

77
// SDK and tools
88
compileSdkVersion = 33

common/src/main/java/jp/co/soramitsu/common/compose/viewstate/AssetListItemViewState.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ data class AssetListItemViewState(
1818
val priceId: String?,
1919
val hasNetworkIssue: Boolean
2020
) {
21-
val key = listOf(chainAssetId, chainId).joinToString()
21+
val key = listOf(chainAssetId, chainId, isHidden).joinToString()
2222
}

feature-wallet-api/src/main/java/jp/co/soramitsu/wallet/impl/domain/interfaces/WalletInteractor.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@ interface WalletInteractor {
8787

8888
suspend fun updateAssets(newItems: List<AssetUpdateItem>)
8989

90-
suspend fun enableCustomAssetSorting()
91-
92-
suspend fun customAssetSortingEnabled(): Boolean
93-
9490
suspend fun markAssetAsHidden(chainId: ChainId, chainAssetId: String)
9591

9692
suspend fun markAssetAsShown(chainId: ChainId, chainAssetId: String)

feature-wallet-impl/src/main/java/jp/co/soramitsu/wallet/impl/data/buyToken/RampProvider.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import android.content.Context
55
import android.net.Uri
66
import jp.co.soramitsu.common.utils.showBrowser
77
import jp.co.soramitsu.feature_wallet_impl.R
8-
import jp.co.soramitsu.wallet.impl.domain.model.BuyTokenRegistry
98
import jp.co.soramitsu.runtime.multiNetwork.chain.model.Chain
9+
import jp.co.soramitsu.wallet.impl.domain.model.BuyTokenRegistry
1010

1111
private const val RAMP_APP_NAME = "Fearless Wallet"
12-
private const val RAMP_APP_LOGO = "https://raw.githubusercontent.com/sora-xor/sora-branding/master/Fearless-Wallet-brand/fearless-wallet-logo-ramp.png"
12+
private const val RAMP_APP_LOGO =
13+
"https://raw.githubusercontent.com/soramitsu/fearless-Android/dff3ebbed4a125621732ee039f2bc74c74f5b58f/common/src/main/res/drawable-xxxhdpi/ic_wallet.png"
1314

1415
class RampProvider(
1516
private val host: String,
@@ -44,7 +45,7 @@ class RampProvider(
4445
return Uri.Builder()
4546
.scheme("https")
4647
.authority(host)
47-
.appendQueryParameter("swapAsset", chainAsset.symbol)
48+
.appendQueryParameter("swapAsset", chainAsset.symbol.uppercase())
4849
.appendQueryParameter("userAddress", address)
4950
.appendQueryParameter("hostApiKey", apiToken)
5051
.appendQueryParameter("hostAppName", RAMP_APP_NAME)

feature-wallet-impl/src/main/java/jp/co/soramitsu/wallet/impl/domain/WalletInteractorImpl.kt

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import jp.co.soramitsu.wallet.impl.domain.model.TransferValidityStatus
3636
import jp.co.soramitsu.wallet.impl.domain.model.WalletAccount
3737
import jp.co.soramitsu.wallet.impl.domain.model.toPhishingModel
3838
import kotlinx.coroutines.Dispatchers
39+
import kotlinx.coroutines.ExperimentalCoroutinesApi
3940
import kotlinx.coroutines.flow.Flow
4041
import kotlinx.coroutines.flow.distinctUntilChanged
4142
import kotlinx.coroutines.flow.filter
@@ -45,7 +46,6 @@ import kotlinx.coroutines.flow.map
4546
import kotlinx.coroutines.flow.withIndex
4647
import kotlinx.coroutines.withContext
4748

48-
private const val CUSTOM_ASSET_SORTING_PREFS_KEY = "customAssetSorting-"
4949
private const val QR_PREFIX_SUBSTRATE = "substrate"
5050
private const val PREFS_WALLET_SELECTED_CHAIN_ID = "wallet_selected_chain_id"
5151

@@ -60,6 +60,7 @@ class WalletInteractorImpl(
6060
private val updatesMixin: UpdatesMixin
6161
) : WalletInteractor, UpdatesProviderUi by updatesMixin {
6262

63+
@OptIn(ExperimentalCoroutinesApi::class)
6364
override fun assetsFlow(): Flow<List<AssetWithStatus>> {
6465
return updatesMixin.tokenRatesUpdate.map {
6566
it.isNotEmpty()
@@ -72,10 +73,7 @@ class WalletInteractorImpl(
7273
}
7374
.filter { it.isNotEmpty() }
7475
.map { assets ->
75-
when {
76-
customAssetSortingEnabled() -> assets.sortedBy { it.asset.sortIndex }
77-
else -> assets.sortedWith(defaultAssetListSort())
78-
}
76+
assets.sortedWith(defaultAssetListSort())
7977
}
8078
}
8179
}
@@ -267,16 +265,6 @@ class WalletInteractorImpl(
267265

268266
override suspend fun getChainAddressForSelectedMetaAccount(chainId: ChainId) = getSelectedMetaAccount().address(getChain(chainId))
269267

270-
override suspend fun customAssetSortingEnabled(): Boolean {
271-
val metaId = accountRepository.getSelectedMetaAccount().id
272-
return preferences.getBoolean("$CUSTOM_ASSET_SORTING_PREFS_KEY$metaId", false)
273-
}
274-
275-
override suspend fun enableCustomAssetSorting() {
276-
val metaId = accountRepository.getSelectedMetaAccount().id
277-
preferences.putBoolean("$CUSTOM_ASSET_SORTING_PREFS_KEY$metaId", true)
278-
}
279-
280268
override suspend fun markAssetAsHidden(chainId: ChainId, chainAssetId: String) {
281269
manageAssetHidden(chainId, chainAssetId, true)
282270
}

0 commit comments

Comments
 (0)