Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tools/markdown-previewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -550,21 +550,22 @@
render();
});

let dark = false;
try {
const savedTheme = localStorage.getItem(STORAGE_KEYS.theme);
if (savedTheme === "dark") {
toggleTheme();
}
} catch {}

let currentView = "both";
try {
const savedView = localStorage.getItem(STORAGE_KEYS.view);
setView(savedView || "both");
} catch {
setView("both");
}
// ── view modes ──
let currentView = "both";
function setView(mode) {
currentView = mode;
workspace.className = "workspace" + (mode === "editor" ? " editor-only" : mode === "preview" ? " preview-only" : "");
Expand All @@ -574,7 +575,7 @@
}
setView("both");
try {
localStorage.setItem(STORAGE_KEYS.view, mode);
localStorage.setItem(STORAGE_KEYS.view, currentView);
} catch {}
// ── resizer ──
const resizer = document.getElementById("resizer");
Expand Down Expand Up @@ -606,7 +607,6 @@
});

// ── theme ──
let dark = false;
function toggleTheme() {
dark = !dark;
try {
Expand Down
Loading