From 24d9e9673d0b21daaf0b8bfe6690303468a73d4e Mon Sep 17 00:00:00 2001 From: Ren Amamiya Date: Mon, 6 Jul 2026 14:28:12 +0700 Subject: [PATCH] . --- .../composeResources/drawable/ic_login.xml | 10 +++++++ .../su/reya/coop/screens/ImportScreen.kt | 29 +------------------ .../reya/coop/screens/UpdateProfileScreen.kt | 2 -- .../su/reya/coop/viewmodel/AuthViewModel.kt | 2 +- 4 files changed, 12 insertions(+), 31 deletions(-) create mode 100644 composeApp/src/androidMain/composeResources/drawable/ic_login.xml diff --git a/composeApp/src/androidMain/composeResources/drawable/ic_login.xml b/composeApp/src/androidMain/composeResources/drawable/ic_login.xml new file mode 100644 index 0000000..820129b --- /dev/null +++ b/composeApp/src/androidMain/composeResources/drawable/ic_login.xml @@ -0,0 +1,10 @@ + + + diff --git a/composeApp/src/androidMain/kotlin/su/reya/coop/screens/ImportScreen.kt b/composeApp/src/androidMain/kotlin/su/reya/coop/screens/ImportScreen.kt index 8aa2f50..967b712 100644 --- a/composeApp/src/androidMain/kotlin/su/reya/coop/screens/ImportScreen.kt +++ b/composeApp/src/androidMain/kotlin/su/reya/coop/screens/ImportScreen.kt @@ -22,7 +22,6 @@ import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.LoadingIndicator -import androidx.compose.material3.MaterialShapes import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Scaffold import androidx.compose.material3.SnackbarHost @@ -30,7 +29,6 @@ import androidx.compose.material3.Surface import androidx.compose.material3.Text import androidx.compose.material3.TopAppBar import androidx.compose.material3.TopAppBarDefaults -import androidx.compose.material3.toShape import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue @@ -40,13 +38,11 @@ import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.SolidColor import androidx.compose.ui.platform.LocalFocusManager import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.PasswordVisualTransformation -import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import coop.composeapp.generated.resources.Res import coop.composeapp.generated.resources.ic_arrow_back @@ -60,7 +56,6 @@ import su.reya.coop.LocalNavigator import su.reya.coop.LocalScanResult import su.reya.coop.LocalSnackbarHostState import su.reya.coop.Screen -import su.reya.coop.shared.getExpressiveFontFamily @OptIn(ExperimentalMaterial3ExpressiveApi::class) @Composable @@ -80,7 +75,7 @@ fun ImportScreen() { LaunchedEffect(qrScanResult.content) { qrScanResult.content?.let { result -> runCatching { - if (result.startsWith("nsec1")) { + if (result.startsWith("nsec1") || result.startsWith("ncryptsec1")) { Keys.parse(result) } else if (result.startsWith("bunker://")) { NostrConnectUri.parse(result) @@ -142,28 +137,6 @@ fun ImportScreen() { .padding(top = innerPadding.calculateTopPadding()) .imePadding(), ) { - Column( - modifier = Modifier - .fillMaxWidth() - .weight(1f), - verticalArrangement = Arrangement.Center, - horizontalAlignment = Alignment.CenterHorizontally - ) { - Box( - modifier = Modifier - .size(120.dp) - .clip(MaterialShapes.Cookie9Sided.toShape()), - contentAlignment = Alignment.Center - ) { - Text( - text = "", - textAlign = TextAlign.Center, - style = MaterialTheme.typography.titleLargeEmphasized.copy( - fontFamily = getExpressiveFontFamily() - ), - ) - } - } Surface( modifier = Modifier .fillMaxWidth() diff --git a/composeApp/src/androidMain/kotlin/su/reya/coop/screens/UpdateProfileScreen.kt b/composeApp/src/androidMain/kotlin/su/reya/coop/screens/UpdateProfileScreen.kt index 074a9b7..efa531a 100644 --- a/composeApp/src/androidMain/kotlin/su/reya/coop/screens/UpdateProfileScreen.kt +++ b/composeApp/src/androidMain/kotlin/su/reya/coop/screens/UpdateProfileScreen.kt @@ -15,7 +15,6 @@ fun UpdateProfileScreen() { val navigator = LocalNavigator.current val scope = rememberCoroutineScope() - val isBusy by nostrViewModel.isBusy.collectAsStateWithLifecycle(false) val currentUser by nostrViewModel.currentUserProfile.collectAsStateWithLifecycle() val profile = currentUser?.metadata?.asRecord() @@ -25,7 +24,6 @@ fun UpdateProfileScreen() { initialName = profile?.displayName ?: profile?.name ?: "", initialBio = profile?.about ?: "", initialPicture = profile?.picture, - isBusy = isBusy, onBack = { navigator.goBack() }, onConfirm = { name, bio, bytes, type -> scope.launch { diff --git a/shared/src/commonMain/kotlin/su/reya/coop/viewmodel/AuthViewModel.kt b/shared/src/commonMain/kotlin/su/reya/coop/viewmodel/AuthViewModel.kt index 1c22e6c..e77db2e 100644 --- a/shared/src/commonMain/kotlin/su/reya/coop/viewmodel/AuthViewModel.kt +++ b/shared/src/commonMain/kotlin/su/reya/coop/viewmodel/AuthViewModel.kt @@ -59,7 +59,7 @@ class AuthViewModel( private fun login() { viewModelScope.launch { try { - val secret = withTimeoutOrNull(3.seconds) { + val secret = withTimeoutOrNull(5.seconds) { secretStore.get(KEY_USER_SIGNER) }