Actualizar asignados.html
This commit is contained in:
@@ -246,6 +246,7 @@
|
|||||||
let pickerSelectedDate = "";
|
let pickerSelectedDate = "";
|
||||||
let pickerSelectedTime = "";
|
let pickerSelectedTime = "";
|
||||||
|
|
||||||
|
// --- SISTEMA DE TEMA DINÁMICO CORREGIDO ---
|
||||||
async function applyTheme() {
|
async function applyTheme() {
|
||||||
try {
|
try {
|
||||||
let theme = JSON.parse(localStorage.getItem('app_theme'));
|
let theme = JSON.parse(localStorage.getItem('app_theme'));
|
||||||
@@ -254,14 +255,20 @@
|
|||||||
});
|
});
|
||||||
const data = await res.json();
|
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;
|
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.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));
|
localStorage.setItem('app_theme', JSON.stringify(theme));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(theme) {
|
if(theme) {
|
||||||
document.documentElement.style.setProperty('--primary', theme.primary);
|
document.documentElement.style.setProperty('--primary', theme.primary);
|
||||||
document.documentElement.style.setProperty('--secondary', theme.secondary);
|
document.documentElement.style.setProperty('--secondary', theme.secondary);
|
||||||
|
|||||||
Reference in New Issue
Block a user