fix(mobile): auto-save watch directory on blur, not via Save button
The Save button is anchored to the Instance section near the top. Moving the auto_import_path write to onBlur on the field itself means the value is persisted as soon as the user leaves the input — no need to scroll up and hit Save.
This commit is contained in:
@@ -37,9 +37,6 @@ export default function SettingsScreen() {
|
||||
async function save() {
|
||||
await setSetting(db, 'instance_url', instanceUrl.trim());
|
||||
await setSetting(db, 'handle', handle.trim());
|
||||
if (Platform.OS === 'android') {
|
||||
await setSetting(db, 'auto_import_path', autoPath.trim());
|
||||
}
|
||||
setSaved(true);
|
||||
setTimeout(() => setSaved(false), 2000);
|
||||
}
|
||||
@@ -173,11 +170,12 @@ export default function SettingsScreen() {
|
||||
placeholder="/sdcard/FitFiles"
|
||||
value={autoPath}
|
||||
onChangeText={setAutoPath}
|
||||
onBlur={() => setSetting(db, 'auto_import_path', autoPath.trim())}
|
||||
autoCapitalize="none"
|
||||
/>
|
||||
<Text style={styles.hint}>
|
||||
New FIT files in this directory are imported automatically in the
|
||||
background. Leave blank to disable. Requires storage permission.
|
||||
New FIT files in this directory are imported automatically when you
|
||||
open the app. Leave blank to disable. Requires storage permission.
|
||||
</Text>
|
||||
</Section>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user