diff --git a/frontend/src/components/SettingsModal.tsx b/frontend/src/components/SettingsModal.tsx index 23ca27e..77dcd5e 100644 --- a/frontend/src/components/SettingsModal.tsx +++ b/frontend/src/components/SettingsModal.tsx @@ -4326,9 +4326,10 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan .then(async () => { setMysqlField({ enabled: false, sqlite_path: '' }); setRestartMsg(t('db.switchedSqlite')); await refreshBackend(); }) .catch((e: any) => setErr(String(e?.message ?? e))); } - // Route THIS profile's logbook to its own SQLite file (config stays in - // opslog.db). db.Open creates+migrates the file if it's new. Pick a name/place. - async function pickSeparateSqlite() { + // Point THIS profile's logbook at a SQLite file (settings stay in the + // settings db). A NEW name is created + migrated empty; an existing file is + // opened with its QSOs. + async function newLogbook() { try { const p = await PickSaveDatabase(); if (!p) return; @@ -4338,6 +4339,16 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan await refreshBackend(); } catch (e: any) { setErr(String(e?.message ?? e)); } } + async function openLogbook() { + try { + const p = await PickOpenDatabase(); + if (!p) return; + await SaveMySQLSettings({ ...mysqlCfg, enabled: false, sqlite_path: p } as any); + setMysqlField({ enabled: false, sqlite_path: p }); + setRestartMsg(t('db.switchedSqliteFile')); + await refreshBackend(); + } catch (e: any) { setErr(String(e?.message ?? e)); } + } function connectMysql() { SaveMySQLSettings(mysqlCfg as any) .then(async () => { setRestartMsg(t('db.switchedMysql')); await refreshBackend(); }) @@ -4360,29 +4371,7 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
{t('db.appDbHint')}
{t('db.logbookFileHint')}