From f14838044d21081d7b540531cccf91eabb0be5ca Mon Sep 17 00:00:00 2001 From: Nystik <236107-Nystik@users.noreply.gitlab.com> Date: Sun, 22 Mar 2026 16:29:24 +0100 Subject: [PATCH] Fix vault manager not showing if no vaults exist --- server/config.js | 7 +++++-- src/shims/loader.js | 5 ++++- src/ui/bootstrap.js | 1 - 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/server/config.js b/server/config.js index 16b4ba0..38129d0 100644 --- a/server/config.js +++ b/server/config.js @@ -32,8 +32,11 @@ function discoverVaults() { console.error("[config] Failed to read VAULT_ROOT:", vaultRoot, e.message); } - // Create a default vault if none exist - if (Object.keys(vaults).length === 0) { + // Optionally create a default vault if none exist + if ( + Object.keys(vaults).length === 0 && + process.env.AUTO_CREATE_DEFAULT === "true" + ) { const defaultPath = path.join(vaultRoot, "My Vault"); try { diff --git a/src/shims/loader.js b/src/shims/loader.js index d80be06..b55f7d2 100644 --- a/src/shims/loader.js +++ b/src/shims/loader.js @@ -16,7 +16,7 @@ import * as osShim from "./node/os.js"; import * as netShim from "./node/net.js"; import * as httpShim from "./node/http.js"; import { vaultService } from "../services/vault-service.js"; -import { showPluginInstallDialog } from "../ui/bootstrap.js"; +import { showPluginInstallDialog, showVaultManager } from "../ui/bootstrap.js"; const DEBUG = true; const _accessLog = new Map(); // "module.property" -> count @@ -135,6 +135,9 @@ if (typeof window.Buffer === "undefined") { window.close = function () { console.log("[ignis] window.close() blocked"); + if (!window.__vaultConfig) { + showVaultManager(); + } }; window.__popupIframe = null; diff --git a/src/ui/bootstrap.js b/src/ui/bootstrap.js index 9e4345d..8192cda 100644 --- a/src/ui/bootstrap.js +++ b/src/ui/bootstrap.js @@ -1,7 +1,6 @@ import { vaultService } from "../services/vault-service.js"; export function showVaultManager() { - if (!document.querySelector(".workspace")) return; if (document.querySelector(".vault-manager-overlay")) return; new window.IgnisUI.VaultManager({