Skip to content

Commit

Permalink
Updated button onClick to save 'hasAccount' status, enabling direct a…
Browse files Browse the repository at this point in the history
…ccount access on startup
  • Loading branch information
Mystic-Nayy committed Oct 29, 2024
1 parent bfe0491 commit 573b508
Showing 1 changed file with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,23 @@ fun AccountInfoView(onContinue: () -> Unit) {
}

Spacer(modifier = Modifier.weight(1f))

Button(
onClick = onContinue,
contentPadding = ButtonDefaults.ContentPadding,
shape = RoundedCornerShape(8.dp),
colors = ButtonDefaults.buttonColors(backgroundColor = Color("#EC796B".toColorInt()), contentColor = Color.White),
modifier = Modifier
.fillMaxWidth()
.height(49.dp)
onClick = {
// Save the account information to DataStore when the button is clicked
scope.launch {
context.dataStore.edit { preferences ->
// Set hasAccount to true when the account creation is finalized
preferences[hasAccountKey] = true
}
}
// Navigate to the next screen
onContinue()
},
contentPadding = ButtonDefaults.ContentPadding,
shape = RoundedCornerShape(8.dp),
colors = ButtonDefaults.buttonColors(backgroundColor = Color("#EC796B".toColorInt()), contentColor = Color.White),
modifier = Modifier
.fillMaxWidth()
.height(49.dp
) {
Row(verticalAlignment = Alignment.CenterVertically) {
Text("Continue")
Expand Down

0 comments on commit 573b508

Please sign in to comment.