diff --git a/app/src/main/java/com/wafflestudio/snutt2/deeplink/DeeplinkExecutor.kt b/app/src/main/java/com/wafflestudio/snutt2/deeplink/DeeplinkExecutor.kt index e1da449a8..b32dee4fa 100644 --- a/app/src/main/java/com/wafflestudio/snutt2/deeplink/DeeplinkExecutor.kt +++ b/app/src/main/java/com/wafflestudio/snutt2/deeplink/DeeplinkExecutor.kt @@ -22,8 +22,10 @@ import kotlinx.coroutines.withContext object DeeplinkExecutor { val deeplinkUri = mutableStateOf(Uri.EMPTY) - fun execute(uri: Uri) { - deeplinkUri.value = uri + fun execute(deeplink: String?) { + deeplink?.let { + deeplinkUri.value = Uri.parse(it) + } } } diff --git a/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/notifications/NotificationPage.kt b/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/notifications/NotificationPage.kt index 233aef7f4..4c94c5e4a 100644 --- a/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/notifications/NotificationPage.kt +++ b/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/notifications/NotificationPage.kt @@ -1,6 +1,5 @@ package com.wafflestudio.snutt2.views.logged_in.notifications -import android.net.Uri import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -81,8 +80,7 @@ fun NotificationPage() { items(notificationList) { it?.let { NotificationItem(it, onClick = { - val uri = Uri.parse(it.deeplink ?: return@NotificationItem) - DeeplinkExecutor.execute(uri) + DeeplinkExecutor.execute(it.deeplink) },) } }