Skip to content

Commit

Permalink
Merge pull request #275 from PermanentOrg/feature/VSP-950-File-names-…
Browse files Browse the repository at this point in the history
…sequence

File names sequence
  • Loading branch information
flaviuvsp authored Apr 23, 2024
2 parents b0257d3 + e7b52d8 commit d28e286
Show file tree
Hide file tree
Showing 5 changed files with 561 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ fun EditFileNamesScreen(
snackbarHost = {
SnackbarHost(hostState = snackbarHostState)
}
) {it
) {
it
Column() {
BottomSheetHeader(
painterResource(id = R.drawable.ic_edit_name),
Expand Down Expand Up @@ -149,25 +150,32 @@ fun EditFileNamesScreen(
cancel = cancel
)

EditFilesOptions.SEQUENCE -> PrependContent()
EditFilesOptions.SEQUENCE -> SequenceFileNamesScreen(
uiState = uiState,
formatDate = viewModel::formatDate,
formatCount = viewModel::formatCount,
applyDateChanges = viewModel::applyChanges,
applyCountChanges = viewModel::applyChanges,
cancel = cancel
)
}
}
}

LaunchedEffect(key1 = uiState.errorMessage) {
uiState.errorMessage?.let {
scope.launch {
snackbarHostState.showSnackbar(it)
viewModel.updateError(null)
LaunchedEffect(key1 = uiState.errorMessage) {
uiState.errorMessage?.let {
scope.launch {
snackbarHostState.showSnackbar(it)
viewModel.updateError(null)
}
}
}
}

LaunchedEffect(key1 = uiState.shouldClose, block = {
if(uiState.shouldClose) {
cancel()
}
})
LaunchedEffect(key1 = uiState.shouldClose, block = {
if (uiState.shouldClose) {
cancel()
}
})
}
}
}

Expand All @@ -177,10 +185,4 @@ private enum class EditFilesOptions(val titleID: Int, val resource: Int) {
SEQUENCE(R.string.sequence, R.drawable.sequence);

fun getLabel(context: Context) = context.getString(titleID)
}

@Composable
fun AppendContent() { /* ... */ }

@Composable
fun PrependContent() { /* ... */ }
}
Loading

0 comments on commit d28e286

Please sign in to comment.