Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {
applicationId = "ltd.grunt.brainwallet"
minSdk = 29
targetSdk = 35
versionCode = 202506331
versionCode = 202506333
versionName = "v4.9.2"
multiDexEnabled = true
base.archivesName.set("${defaultConfig.versionName}(${defaultConfig.versionCode})")
Expand Down Expand Up @@ -258,6 +258,7 @@ dependencies {
implementation(libs.android.installreferrer)
implementation("androidx.compose.animation:animation:1.5.0")
implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.7")
implementation("io.coil-kt:coil-compose:2.0.0-rc01")
testImplementation(libs.junit)
testImplementation(libs.mockk)
testImplementation(libs.turbine)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/brainwallet/constants/BWConstants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ object BWConstants {
const val SUPPORT_WEB_LINK: String = "https://www.brainwallet.co/support"
const val TOS_LINK: String = "https://www.brainwallet.co/privacypolicy"
const val LINKTREE_URL: String = "https://linktr.ee/brainwallet"
const val BITREFILL_URL: String = "https://www.bitrefill.com/?ref=2h186s7q"
const val BITREFILL_URL: String = "https://www.bitrefill.com/?ref=bw_tk_26"

/**
* API Hosts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.brainwallet.data.repository
import com.brainwallet.data.source.RemoteConfigSource
import com.brainwallet.presenter.entities.ShopCard
import com.brainwallet.presenter.entities.ShopConfig
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
Expand All @@ -10,7 +12,8 @@ import timber.log.Timber

@Serializable
data class ShopProxy(
@SerialName("widget_url") val widget: String = ""
@SerialName("widget_url") val widget: String = "",
@SerialName("cards") val shopCards: List<ShopCard> = emptyList()
)

interface ShopProxyRepository {
Expand All @@ -34,14 +37,14 @@ class ShopProxyRepositoryImpl(
Timber.d("ShopProxy rawJson: '$rawJson'")

runCatching {
val wrapper = json.decodeFromString<ShopProxyWrapper>(rawJson)
Timber.d("ShopProxy parsed: ${wrapper.shopProxy}")
_shopProxy.value = wrapper.shopProxy
val shopConfig = json.decodeFromString<ShopConfig>(rawJson)
Timber.d("ShopConfig parsed: ${shopConfig.shopData}")
_shopProxy.value = listOf(shopConfig.shopData).map {
ShopProxy(
widget = it.widgetUrl,
shopCards = it.cards
)
}
}.onFailure { Timber.e(it, "RemoteConfig parse failed") }
}

@Serializable
private data class ShopProxyWrapper(
@SerialName("shop_data") val shopProxy: List<ShopProxy> = emptyList()
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ fun NavGraphBuilder.mainNavGraph(
}

composable<Route.BitrefillWeb> { navBackStackEntry ->
val route: Route.LinktreeWeb = navBackStackEntry.toRoute()
val route: Route.BitrefillWeb = navBackStackEntry.toRoute()
WebModalScreen(
onNavigate = onNavigate,
url = BWConstants.BITREFILL_URL
url = route.url
)
}
}
2 changes: 1 addition & 1 deletion app/src/main/java/com/brainwallet/navigation/Route.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ sealed class Route : JavaSerializable {
object MoonPayBuy : Route()

@Serializable
object BitrefillWeb : Route()
data class BitrefillWeb(val url: String) : Route()

@Serializable
object LinktreeWeb : Route()
Expand Down
Loading
Loading