Skip to content

Commit c83e9f3

Browse files
fix(settings): stop auto-save from overwriting path-hide input during editing
1 parent 69631fb commit c83e9f3

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

app/src/main/java/me/bmax/apatch/ui/screen/settings/FunctionSettings.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import androidx.compose.ui.res.stringResource
6363
import androidx.compose.ui.text.font.FontFamily
6464
import androidx.compose.ui.text.font.FontWeight
6565
import androidx.compose.ui.text.input.KeyboardType
66+
import androidx.compose.ui.text.input.ImeAction
6667
import androidx.compose.ui.text.style.TextOverflow
6768
import androidx.compose.ui.graphics.Color
6869
import androidx.compose.ui.unit.dp
@@ -200,7 +201,7 @@ fun FunctionSettingsContent(
200201
supportingText = { Text(umountPathsHelper) },
201202
minLines = 4,
202203
maxLines = Int.MAX_VALUE,
203-
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text),
204+
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text, imeAction = ImeAction.None),
204205
)
205206

206207
Spacer(modifier = Modifier.height(12.dp))
@@ -372,7 +373,7 @@ fun FunctionSettingsContent(
372373
supportingText = { Text(pathsHelper) },
373374
minLines = 4,
374375
maxLines = Int.MAX_VALUE,
375-
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text),
376+
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text, imeAction = ImeAction.None),
376377
)
377378

378379
Spacer(modifier = Modifier.height(12.dp))

app/src/main/java/me/bmax/apatch/ui/screen/settings/FunctionSettingsScreen.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,6 @@ fun FunctionSettingsScreen(navigator: DestinationsNavigator, highlightKey: Strin
181181
.debounce(1000L)
182182
.collect { paths ->
183183
val normalizedPaths = normalizePathHidePaths(paths)
184-
if (normalizedPaths != paths) {
185-
withContext(Dispatchers.Main) {
186-
pathHidePaths = normalizedPaths
187-
}
188-
}
189184
writePathHidePaths(normalizedPaths)
190185
Natives.pathHideClear()
191186
if (normalizedPaths.isNotBlank()) {

0 commit comments

Comments
 (0)