fix(mobile): gate watch directory on instance URL; skip auto-scan if unconfigured

Settings: watch directory field is hidden behind a warning if no instance
URL is saved yet, making the dependency explicit before the user sets a
path.

Import: runAutoScan silently skips (no errors) when instance URL is
missing; manualScan shows a single clear message instead of one failure
per file.
This commit is contained in:
Davide Scaini
2026-04-25 22:20:02 +02:00
parent 42d829737c
commit a5c2810568
2 changed files with 28 additions and 12 deletions
+7
View File
@@ -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);