Actualizar asignados.html
This commit is contained in:
@@ -246,6 +246,7 @@
|
||||
let pickerSelectedDate = "";
|
||||
let pickerSelectedTime = "";
|
||||
|
||||
// --- SISTEMA DE TEMA DINÁMICO CORREGIDO ---
|
||||
async function applyTheme() {
|
||||
try {
|
||||
let theme = JSON.parse(localStorage.getItem('app_theme'));
|
||||
@@ -254,14 +255,20 @@
|
||||
});
|
||||
const data = await res.json();
|
||||
|
||||
if(data.ok && data.config && data.config.portal_settings) {
|
||||
if(data.ok && data.config) {
|
||||
// 1. Extraemos los horarios (Están dentro de portal_settings)
|
||||
if (data.config.portal_settings) {
|
||||
const ps = data.config.portal_settings;
|
||||
if(ps.m_start) bizHours = { m_start: ps.m_start, m_end: ps.m_end, a_start: ps.a_start, a_end: ps.a_end };
|
||||
if(ps.app_settings) {
|
||||
theme = ps.app_settings;
|
||||
}
|
||||
|
||||
// 2. Extraemos los colores (Están FUERA, en su propia columna app_settings)
|
||||
if (data.config.app_settings) {
|
||||
theme = data.config.app_settings;
|
||||
localStorage.setItem('app_theme', JSON.stringify(theme));
|
||||
}
|
||||
}
|
||||
|
||||
if(theme) {
|
||||
document.documentElement.style.setProperty('--primary', theme.primary);
|
||||
document.documentElement.style.setProperty('--secondary', theme.secondary);
|
||||
|
||||
Reference in New Issue
Block a user