From 42eec1ff6df46407b8dc978d9ae31ed8c24191b2 Mon Sep 17 00:00:00 2001 From: algosketch Date: Thu, 23 May 2024 01:06:07 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix=20:=20[=EB=94=A5=20=EB=A7=81=ED=81=AC]?= =?UTF-8?q?=20=EB=92=A4=EB=A1=9C=20=EA=B0=80=EA=B8=B0=EC=8B=9C=20=ED=99=88?= =?UTF-8?q?=EC=9D=B4=20=EC=95=84=EB=8B=8C=20=ED=8B=B0=EC=BC=93=20=EC=B1=95?= =?UTF-8?q?=EC=9D=B4=20=EB=82=98=EC=98=A4=EB=8A=94=20=ED=98=84=EC=83=81=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/screen/home/HomeScreen.kt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/presentation/src/main/java/com/nexters/boolti/presentation/screen/home/HomeScreen.kt b/presentation/src/main/java/com/nexters/boolti/presentation/screen/home/HomeScreen.kt index 9c20a35c..86a7b0c3 100644 --- a/presentation/src/main/java/com/nexters/boolti/presentation/screen/home/HomeScreen.kt +++ b/presentation/src/main/java/com/nexters/boolti/presentation/screen/home/HomeScreen.kt @@ -1,5 +1,6 @@ package com.nexters.boolti.presentation.screen.home +import android.content.Context import android.content.Intent import android.net.Uri import androidx.annotation.DrawableRes @@ -20,6 +21,7 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.Stable import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp @@ -32,6 +34,7 @@ import androidx.navigation.compose.currentBackStackEntryAsState import androidx.navigation.compose.rememberNavController import androidx.navigation.navDeepLink import com.nexters.boolti.presentation.R +import com.nexters.boolti.presentation.extension.requireActivity import com.nexters.boolti.presentation.screen.HomeViewModel import com.nexters.boolti.presentation.screen.my.MyScreen import com.nexters.boolti.presentation.screen.show.ShowScreen @@ -40,7 +43,6 @@ import com.nexters.boolti.presentation.screen.ticket.TicketScreen import com.nexters.boolti.presentation.theme.Grey10 import com.nexters.boolti.presentation.theme.Grey50 import com.nexters.boolti.presentation.theme.Grey85 -import kotlinx.coroutines.channels.consumeEach @Composable fun HomeScreen( @@ -61,6 +63,8 @@ fun HomeScreen( val loggedIn by viewModel.loggedIn.collectAsStateWithLifecycle() + removeInvalidDeepLink(LocalContext.current) + LaunchedEffect(Unit) { viewModel.event.collect { deepLink -> navController.navigate(Uri.parse(deepLink)) @@ -135,6 +139,19 @@ fun HomeScreen( } } +/** + * issue #209를 해결하기 위한 메서드. + * 처리하지 말아야 할 deep link가 부적절한 destination과 match되는 것을 방지하기 위함. + */ +private fun removeInvalidDeepLink(context: Context) { + runCatching { + val intent = context.requireActivity().intent + if (intent.action == null) return + val deepLink = intent.action!! + if (!deepLink.contains("home")) intent.setAction(null) + } +} + @Stable private enum class Destination( val route: String, From 1c1cf92b82ff19381fe602f2fcaf04190ee68408 Mon Sep 17 00:00:00 2001 From: algosketch Date: Sun, 15 Dec 2024 14:58:30 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix=20:=20=EC=95=8A=EC=9D=B4=20=EC=9D=B4?= =?UTF-8?q?=EA=B1=B0=20=EB=A0=88=EC=9D=B4=EB=94=94=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EB=95=8C=EB=AC=B8=EC=97=90=20=EC=9E=84?= =?UTF-8?q?=EC=8B=9C=EB=A1=9C=20=EB=B0=94=EA=BE=BC=EA=B1=B4=EB=8D=B0=20?= =?UTF-8?q?=EC=98=AC=EB=9D=BC=EA=B0=80=EB=B2=84=EB=A0=B8=EB=84=A4.=20?= =?UTF-8?q?=EC=95=94=ED=8A=BC=20=EC=95=88=EC=8A=A4=20=ED=83=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/domain/build.gradle.kts b/domain/build.gradle.kts index ee8c18ab..9ebc31fd 100644 --- a/domain/build.gradle.kts +++ b/domain/build.gradle.kts @@ -5,8 +5,8 @@ plugins { } java { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } tasks.withType().configureEach {