Avoid setting blank folder name.

This commit is contained in:
Sagar
2025-04-18 21:05:02 +05:30
committed by Cody Henthorne
parent ba08399d35
commit b246e62504

View File

@@ -366,12 +366,12 @@ fun CreateFolderScreen(
Buttons.MediumTonal(
colors = ButtonDefaults.filledTonalButtonColors(
contentColor = if (state.currentFolder.folderRecord.name.isEmpty()) {
contentColor = if (state.currentFolder.folderRecord.name.isBlank()) {
MaterialTheme.colorScheme.onSurface.copy(alpha = 0.38f)
} else {
MaterialTheme.colorScheme.onSurface
},
containerColor = if (state.currentFolder.folderRecord.name.isEmpty()) {
containerColor = if (state.currentFolder.folderRecord.name.isBlank()) {
MaterialTheme.colorScheme.surfaceVariant
} else {
MaterialTheme.colorScheme.primaryContainer
@@ -380,7 +380,7 @@ fun CreateFolderScreen(
),
enabled = hasChanges,
onClick = {
if (state.currentFolder.folderRecord.name.isEmpty()) {
if (state.currentFolder.folderRecord.name.isBlank()) {
onShowToast()
} else {
onCreateConfirmed()