fix: add missing state. prefix to all bare state variable references across all modules
CI / lint (push) Successful in 15s
CI / security (push) Successful in 8s
CI / test (push) Successful in 16s
CI / build (push) Successful in 2s

This commit is contained in:
2026-05-28 18:33:39 -04:00
parent 75fac8256b
commit 148b3851ae
8 changed files with 47 additions and 47 deletions
+11 -11
View File
@@ -36,9 +36,9 @@ export const RightSidebarManager = {
if (!sidebar) return;
if (rightSidebarVisible) {
if (state.rightSidebarVisible) {
sidebar.classList.remove("hidden");
sidebar.style.width = `${rightSidebarWidth}px`;
sidebar.style.width = `${state.rightSidebarWidth}px`;
if (handle) handle.classList.remove("hidden");
if (tocBtn) {
tocBtn.classList.add("active");
@@ -67,7 +67,7 @@ export const RightSidebarManager = {
toggle() {
state.rightSidebarVisible = !state.rightSidebarVisible;
localStorage.setItem("obsigate-right-sidebar-visible", rightSidebarVisible);
localStorage.setItem("obsigate-right-sidebar-visible", state.rightSidebarVisible);
this.applyState();
},
@@ -118,7 +118,7 @@ export const RightSidebarManager = {
document.body.style.cursor = "";
document.body.style.userSelect = "";
localStorage.setItem("obsigate-right-sidebar-width", rightSidebarWidth);
localStorage.setItem("obsigate-right-sidebar-width", state.rightSidebarWidth);
};
handle.addEventListener("mousedown", onMouseDown);
@@ -905,10 +905,10 @@ const FileOperations = {
if (type === 'file' && state.currentVault === vault && state.currentPath === path) {
await openFile(vault, nextPath);
} else if (type === 'directory' && state.currentVault === vault && currentPath && (state.currentPath === path || currentPath.startsWith(`${path}/`))) {
} else if (type === 'directory' && state.currentVault === vault && state.currentPath && (state.currentPath === path || currentPath.startsWith(`${path}/`))) {
const suffix = state.currentPath === path ? '' : currentPath.slice(path.length);
state.currentPath = `${nextPath}${suffix}`;
await focusPathInSidebar(vault, currentPath, { alignToTop: false });
await focusPathInSidebar(vault, state.currentPath, { alignToTop: false });
}
showToast(type === 'directory' ? 'Dossier renommé' : 'Fichier renommé', 'success');
@@ -992,7 +992,7 @@ const FileOperations = {
this._closeModal(overlay);
await refreshSidebarTreePreservingState();
if (state.currentVault === vault && currentPath && currentPath.startsWith(path)) {
if (state.currentVault === vault && state.currentPath && currentPath.startsWith(path)) {
showWelcome();
}
} catch (err) {
@@ -1922,8 +1922,8 @@ export const TabManager = {
if (!cache) return;
// Update global state
currentVault = cache.vault;
currentPath = cache.path;
state.currentVault = cache.vault;
state.currentPath = cache.path;
syncActiveFileTreeItem(cache.vault, cache.path);
const area = document.getElementById("content-area");
@@ -2098,8 +2098,8 @@ export const TabManager = {
// Refresh widgets after restoring
if (typeof DashboardStatsWidget !== "undefined") DashboardStatsWidget.load();
if (typeof DashboardConflictsWidget !== "undefined") DashboardConflictsWidget.load();
if (typeof DashboardRecentWidget !== "undefined") DashboardRecentWidget.load(selectedContextVault);
if (typeof DashboardBookmarkWidget !== "undefined") DashboardBookmarkWidget.load(selectedContextVault);
if (typeof DashboardRecentWidget !== "undefined") DashboardRecentWidget.load(state.selectedContextVault);
if (typeof DashboardBookmarkWidget !== "undefined") DashboardBookmarkWidget.load(state.selectedContextVault);
if (history.pushState) {
history.pushState(null, "", "#");
}