Skip to content

Commit 5f125f0

Browse files
committed
Fix for DB reset without users
Signed-off-by: Mike Lischke <mike@lischke-online.de>
1 parent 587789d commit 5f125f0

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/App.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -628,11 +628,15 @@ export class App extends UIComponent<{}, IAppState> {
628628
return;
629629
}
630630

631-
await this.setStatePromise({ phase: AppPhase.Login });
632-
const loggedIn = await this.loginDialogRef.current?.show(true);
631+
// Skip login when there are no users (e.g., schema broken,
632+
// users table missing). The backend allows emergency reset without auth.
633+
if (health.hasUsers) {
634+
await this.setStatePromise({ phase: AppPhase.Login });
635+
const loggedIn = await this.loginDialogRef.current?.show(true);
633636

634-
if (!loggedIn) {
635-
return;
637+
if (!loggedIn) {
638+
return;
639+
}
636640
}
637641

638642
const ok = await this.dataModel.resetDatabase();

0 commit comments

Comments
 (0)