This commit is contained in:
Davide Scaini
2026-04-25 15:33:51 +02:00
parent 1ac35c84e0
commit 5330b7b489
7 changed files with 53 additions and 18 deletions
+12 -10
View File
@@ -19,6 +19,8 @@ export default function SettingsScreen() {
const [instanceUrl, setInstanceUrl] = useState(storedUrl);
const [handle, setHandle] = useState(storedHandle);
const [autoPath, setAutoPath] = useState(storedPath);
const [syncMode, setSyncMode] = useState(storedSyncMode);
const [syncUpload, setSyncUpload] = useState(storedSyncUpload);
const [saved, setSaved] = useState(false);
const [password, setPassword] = useState('');
@@ -181,17 +183,17 @@ export default function SettingsScreen() {
<View style={styles.modeRow}>
<ModeButton
label="Summaries only"
active={storedSyncMode === 'summaries'}
onPress={() => setSetting(db, 'sync_mode', 'summaries')}
active={syncMode === 'summaries'}
onPress={() => { setSyncMode('summaries'); setSetting(db, 'sync_mode', 'summaries'); }}
/>
<ModeButton
label="Full data"
active={storedSyncMode === 'full'}
onPress={() => setSetting(db, 'sync_mode', 'full')}
active={syncMode === 'full'}
onPress={() => { setSyncMode('full'); setSetting(db, 'sync_mode', 'full'); }}
/>
</View>
<Text style={styles.hint}>
{storedSyncMode === 'full'
{syncMode === 'full'
? 'Downloads map route and elevation chart for every activity during sync. Uses more storage and takes longer.'
: 'Syncs activity summaries only. Map and chart are fetched on demand when you open an activity.'}
</Text>
@@ -199,17 +201,17 @@ export default function SettingsScreen() {
<View style={styles.modeRow}>
<ModeButton
label="Off"
active={!storedSyncUpload}
onPress={() => setSetting(db, 'sync_upload', 'false')}
active={!syncUpload}
onPress={() => { setSyncUpload(false); setSetting(db, 'sync_upload', 'false'); }}
/>
<ModeButton
label="Upload local activities"
active={storedSyncUpload}
onPress={() => setSetting(db, 'sync_upload', 'true')}
active={syncUpload}
onPress={() => { setSyncUpload(true); setSetting(db, 'sync_upload', 'true'); }}
/>
</View>
<Text style={styles.hint}>
{storedSyncUpload
{syncUpload
? 'Local activities are uploaded to the instance during sync.'
: 'Local activities stay on device only.'}
</Text>