fix
This commit is contained in:
@@ -78,7 +78,7 @@ fun ImportScreen() {
|
||||
|
||||
val scope = rememberCoroutineScope()
|
||||
|
||||
val isLoggedIn by viewModel.isLoggedIn.collectAsStateWithLifecycle(false)
|
||||
val isBusy by viewModel.isBusy.collectAsStateWithLifecycle(false)
|
||||
var secret by remember { mutableStateOf("") }
|
||||
var pubkey by remember { mutableStateOf<PublicKey?>(null) }
|
||||
|
||||
@@ -90,7 +90,7 @@ fun ImportScreen() {
|
||||
val profile = metadata?.asRecord()
|
||||
val displayName = profile?.displayName ?: profile?.name ?: pubkey?.short() ?: "Unknown"
|
||||
val picture = profile?.picture
|
||||
|
||||
|
||||
LaunchedEffect(qrScanResult.content) {
|
||||
qrScanResult.content?.let { result ->
|
||||
runCatching {
|
||||
@@ -205,7 +205,7 @@ fun ImportScreen() {
|
||||
BasicTextField(
|
||||
value = secret,
|
||||
onValueChange = { secret = it },
|
||||
enabled = !isLoggedIn,
|
||||
enabled = !isBusy,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
maxLines = 4,
|
||||
keyboardOptions = KeyboardOptions(
|
||||
@@ -258,9 +258,9 @@ fun ImportScreen() {
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(ButtonDefaults.MediumContainerHeight),
|
||||
enabled = secret.isNotBlank() && !isLoggedIn,
|
||||
enabled = secret.isNotBlank() && !isBusy,
|
||||
) {
|
||||
if (isLoggedIn) {
|
||||
if (isBusy) {
|
||||
LoadingIndicator()
|
||||
} else {
|
||||
Text(
|
||||
|
||||
@@ -15,12 +15,12 @@ fun NewIdentityScreen() {
|
||||
val viewModel = LocalNostrViewModel.current
|
||||
val navigator = LocalNavigator.current
|
||||
val scope = rememberCoroutineScope()
|
||||
val isLoggedIn by viewModel.isLoggedIn.collectAsStateWithLifecycle(false)
|
||||
val isBusy by viewModel.isBusy.collectAsStateWithLifecycle(false)
|
||||
|
||||
ProfileEditor(
|
||||
title = "Create a new identity",
|
||||
buttonLabel = "Continue",
|
||||
isBusy = isLoggedIn,
|
||||
isBusy = isBusy,
|
||||
onBack = { navigator.goBack() },
|
||||
onConfirm = { name, bio, bytes, type ->
|
||||
scope.launch {
|
||||
|
||||
@@ -160,9 +160,10 @@ fun OnboardingScreen() {
|
||||
if (viewModel.isExternalSignerAvailable()) {
|
||||
try {
|
||||
viewModel.connectExternalSigner()
|
||||
navigator.navigate(Screen.Home)
|
||||
} catch (e: Exception) {
|
||||
e.message?.let { snackbarHostState.showSnackbar(it) }
|
||||
} finally {
|
||||
navigator.navigate(Screen.Home)
|
||||
}
|
||||
} else {
|
||||
val result = snackbarHostState.showSnackbar(
|
||||
|
||||
@@ -18,7 +18,7 @@ fun UpdateProfileScreen() {
|
||||
|
||||
val currentUser = viewModel.currentUser() ?: return
|
||||
val metadata by viewModel.getMetadata(currentUser).collectAsState(initial = null)
|
||||
val isBusy by viewModel.isLoggedIn.collectAsStateWithLifecycle(false)
|
||||
val isBusy by viewModel.isBusy.collectAsStateWithLifecycle(false)
|
||||
|
||||
val profile = metadata?.asRecord()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user