Skip to content

Commit

Permalink
fix: custom command directory folder picker
Browse files Browse the repository at this point in the history
  • Loading branch information
JunkFood02 committed Aug 10, 2023
1 parent 4d24d56 commit 7e76d8d
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ fun DownloadDirectoryPreferences(onBackPressed: () -> Unit) {
var showClearTempDialog by remember { mutableStateOf(false) }
var showCustomCommandDirectoryDialog by remember { mutableStateOf(false) }

var customCommandDirectoryText by remember(showCustomCommandDirectoryDialog) {
mutableStateOf(
customCommandDirectory
)
}

var editingDirectory by remember { mutableStateOf(Directory.VIDEO) }

val isCustomCommandEnabled by remember {
Expand Down Expand Up @@ -466,7 +472,6 @@ fun DownloadDirectoryPreferences(onBackPressed: () -> Unit) {
)
}
if (showCustomCommandDirectoryDialog) {
var directory by remember { mutableStateOf(customCommandDirectory) }
AlertDialog(
onDismissRequest = { showCustomCommandDirectoryDialog = false },
icon = { Icon(imageVector = Icons.Outlined.Folder, contentDescription = null) },
Expand All @@ -478,8 +483,7 @@ fun DownloadDirectoryPreferences(onBackPressed: () -> Unit) {
},
confirmButton = {
ConfirmButton {
COMMAND_DIRECTORY.updateString(directory)
customCommandDirectory = directory
COMMAND_DIRECTORY.updateString(customCommandDirectory)
showCustomCommandDirectoryDialog = false
}
},
Expand All @@ -496,8 +500,8 @@ fun DownloadDirectoryPreferences(onBackPressed: () -> Unit) {
)
OutlinedTextField(
modifier = Modifier.padding(vertical = 8.dp),
value = directory,
onValueChange = { directory = it },
value = customCommandDirectory,
onValueChange = { customCommandDirectory = it },
leadingIcon = { Text(text = "-P", fontFamily = FontFamily.Monospace) },
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
)
Expand Down

0 comments on commit 7e76d8d

Please sign in to comment.