Skip to content

Commit 0547ab4

Browse files
committed
Refactor: Move JS snippet to DiscordLoginWebView
1 parent 8ff6bda commit 0547ab4

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

feature_profile/src/main/java/com/my/kizzy/feature_profile/ui/component/DiscordLoginWebView.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ import android.webkit.WebView
2121
import android.webkit.WebViewClient
2222
import androidx.compose.runtime.Composable
2323
import androidx.compose.ui.viewinterop.AndroidView
24-
import com.my.kizzy.feature_profile.ui.login.JS_SNIPPET
24+
25+
const val JS_SNIPPET =
26+
"javascript:(function()%7Bvar%20i%3Ddocument.createElement('iframe')%3Bdocument.body.appendChild(i)%3Balert(i.contentWindow.localStorage.token.slice(1,-1))%7D)()"
2527

2628
@SuppressLint("SetJavaScriptEnabled")
2729
@Composable

feature_profile/src/main/java/com/my/kizzy/feature_profile/ui/login/LoginScreen.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ import com.my.kizzy.preference.Prefs.TOKEN
2929
import com.my.kizzy.ui.components.BackButton
3030
import kotlinx.coroutines.launch
3131

32-
const val JS_SNIPPET =
33-
"javascript:(function()%7Bvar%20i%3Ddocument.createElement('iframe')%3Bdocument.body.appendChild(i)%3Balert(i.contentWindow.localStorage.token.slice(1,-1))%7D)()"
34-
3532
@OptIn(ExperimentalMaterial3Api::class)
3633
@SuppressLint("SetJavaScriptEnabled")
3734
@Composable

0 commit comments

Comments
 (0)