diff --git a/public/app.js b/public/app.js
index b280439..d7b1540 100644
--- a/public/app.js
+++ b/public/app.js
@@ -134,6 +134,13 @@ function getTimestampCustomFormat() {
function pad2(v) { return String(v).padStart(2, '0'); }
function pad3(v) { return String(v).padStart(3, '0'); }
+function mergeUserHomeConfig(siteConfig, userTheme) {
+ if (!siteConfig || !userTheme || !userTheme.home || typeof userTheme.home !== 'object') return siteConfig;
+ const serverHome = (siteConfig.home && typeof siteConfig.home === 'object') ? siteConfig.home : {};
+ siteConfig.home = Object.assign({}, serverHome, userTheme.home);
+ return siteConfig;
+}
+
function formatIsoLike(d, timezone, includeMs) {
const useUtc = timezone === 'utc';
const year = useUtc ? d.getUTCFullYear() : d.getFullYear();
@@ -727,6 +734,7 @@ window.addEventListener('DOMContentLoaded', () => {
// User's localStorage preferences take priority over server config
const userTheme = (() => { try { return JSON.parse(localStorage.getItem('meshcore-user-theme') || '{}'); } catch { return {}; } })();
+ mergeUserHomeConfig(window.SITE_CONFIG, userTheme);
// Apply CSS variable overrides from theme config (skipped if user has local overrides)
if (!userTheme.theme && !userTheme.themeDark) {
diff --git a/public/customize.js b/public/customize.js
index ac2805d..c879ebe 100644
--- a/public/customize.js
+++ b/public/customize.js
@@ -536,7 +536,9 @@
// Auto-save to localStorage on every change
let _autoSaveTimer = null;
+ let _initialized = false;
function autoSave() {
+ if (!_initialized) return;
if (_autoSaveTimer) clearTimeout(_autoSaveTimer);
_autoSaveTimer = setTimeout(function() {
_autoSaveTimer = null;
@@ -546,7 +548,6 @@
// Sync to SITE_CONFIG so live pages (home, etc.) pick up changes
if (window.SITE_CONFIG) {
if (state.branding) window.SITE_CONFIG.branding = Object.assign(window.SITE_CONFIG.branding || {}, state.branding);
- if (state.home) window.SITE_CONFIG.home = deepClone(state.home);
}
// Re-render current page to reflect home/branding changes
window.dispatchEvent(new HashChangeEvent('hashchange'));
@@ -1358,6 +1359,7 @@
// First open — create the panel
injectStyles();
saveOriginalCSS();
+ _initialized = false;
initState();
panelEl = document.createElement('div');
@@ -1390,7 +1392,8 @@
});
render(panelEl.querySelector('.cust-inner'));
- applyThemePreview(); autoSave();
+ applyThemePreview();
+ _initialized = true;
}
// Restore saved user theme IMMEDIATELY (before DOMContentLoaded, before map/app init)
diff --git a/public/index.html b/public/index.html
index 2ede25e..069d511 100644
--- a/public/index.html
+++ b/public/index.html
@@ -22,9 +22,9 @@
-
-
-
+
+
+
@@ -81,31 +81,33 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+