Skip to content

Commit fd3403b

Browse files
committed
fix: geo block validation
1 parent 43d847f commit fd3403b

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

app/src/main/java/to/bitkit/ui/MainActivity.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ class MainActivity : FragmentActivity() {
121121
val route = navBackEntry.toRoute<StartupRoutes.Slides>()
122122
OnboardingSlidesScreen(
123123
currentTab = route.tab,
124+
isGeoBlocked = appViewModel.isGeoBlocked == true,
124125
onAdvancedSetupClick = { startupNavController.navigate(StartupRoutes.Advanced) },
125126
onCreateClick = {
126127
scope.launch {

app/src/main/java/to/bitkit/ui/onboarding/OnboardingSlidesScreen.kt

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import to.bitkit.ui.utils.withAccent
5454
@Composable
5555
fun OnboardingSlidesScreen(
5656
currentTab: Int = 0,
57+
isGeoBlocked: Boolean,
5758
onAdvancedSetupClick: () -> Unit,
5859
onCreateClick: () -> Unit,
5960
onRestoreClick: () -> Unit,
@@ -86,7 +87,7 @@ fun OnboardingSlidesScreen(
8687
title = stringResource(R.string.onboarding__slide1_header),
8788
titleAccentColor = Colors.Purple,
8889
text = stringResource(R.string.onboarding__slide1_text),
89-
disclaimerText = stringResource(R.string.onboarding__slide1_note), // TODO use GeoBlocking state
90+
disclaimerText = stringResource(R.string.onboarding__slide1_note).takeIf { isGeoBlocked },
9091
modifier = Modifier.testTag("Slide1")
9192
)
9293

@@ -239,6 +240,35 @@ private fun OnboardingViewPreview() {
239240
onAdvancedSetupClick = {},
240241
onCreateClick = {},
241242
onRestoreClick = {},
243+
isGeoBlocked = true
244+
)
245+
}
246+
}
247+
248+
@Preview(showSystemUi = true)
249+
@Composable
250+
private fun OnboardingViewPreview2() {
251+
AppThemeSurface {
252+
OnboardingSlidesScreen(
253+
currentTab = 1,
254+
onAdvancedSetupClick = {},
255+
onCreateClick = {},
256+
onRestoreClick = {},
257+
isGeoBlocked = true
258+
)
259+
}
260+
}
261+
262+
@Preview(showSystemUi = true)
263+
@Composable
264+
private fun OnboardingViewPreview3() {
265+
AppThemeSurface {
266+
OnboardingSlidesScreen(
267+
currentTab = 1,
268+
onAdvancedSetupClick = {},
269+
onCreateClick = {},
270+
onRestoreClick = {},
271+
isGeoBlocked = false
242272
)
243273
}
244274
}

0 commit comments

Comments
 (0)