diff --git a/mobile/app/(tabs)/import.tsx b/mobile/app/(tabs)/import.tsx index d25701e..324e2f0 100644 --- a/mobile/app/(tabs)/import.tsx +++ b/mobile/app/(tabs)/import.tsx @@ -53,6 +53,8 @@ export default function ImportScreen() { if (isImporting.current) return; const path = await getSetting(db, 'auto_import_path'); if (!path) return; + const instanceUrl = await getSetting(db, 'instance_url'); + if (!instanceUrl) return; // silently skip — engine can't be downloaded without an instance const newFiles = await discoverNewFiles(db, path); if (newFiles.length === 0) return; @@ -69,6 +71,11 @@ export default function ImportScreen() { if (isImporting.current) return; const path = await getSetting(db, 'auto_import_path'); if (!path) return; + const instanceUrl = await getSetting(db, 'instance_url'); + if (!instanceUrl) { + setState({ status: 'error', message: 'No Bincio instance configured. Go to Settings and enter an instance URL first — it\'s needed to download the extraction engine.' }); + return; + } setState({ status: 'loading', msg: 'Scanning…', current: 0, total: 0 }); const newFiles = await discoverNewFiles(db, path); diff --git a/mobile/app/(tabs)/settings.tsx b/mobile/app/(tabs)/settings.tsx index 27fdef1..1d08085 100644 --- a/mobile/app/(tabs)/settings.tsx +++ b/mobile/app/(tabs)/settings.tsx @@ -165,18 +165,26 @@ export default function SettingsScreen() { {Platform.OS === 'android' && (
- setSetting(db, 'auto_import_path', autoPath.trim())} - autoCapitalize="none" - /> - - New FIT files in this directory are imported automatically when you - open the app. Leave blank to disable. Requires storage permission. - + {!storedUrl ? ( + + Configure and save a Bincio instance URL above first — it's needed to download the extraction engine. + + ) : ( + <> + setSetting(db, 'auto_import_path', autoPath.trim())} + autoCapitalize="none" + /> + + New FIT files in this folder are imported automatically when you + open the app. Leave blank to disable. Requires storage permission. + + + )}
)} @@ -326,6 +334,7 @@ const styles = StyleSheet.create({ fieldLabel: { color: '#71717a', fontSize: 11, marginBottom: 4 }, input: { color: '#f4f4f5', fontSize: 15 }, hint: { color: '#52525b', fontSize: 12, lineHeight: 16, padding: 12 }, + hintWarn: { color: '#a16207' }, row: { flexDirection: 'row', justifyContent: 'space-between', paddingHorizontal: 14, paddingVertical: 12,