Actualizar automatizaciones.html
This commit is contained in:
@@ -151,6 +151,7 @@
|
|||||||
let scrapedData = [];
|
let scrapedData = [];
|
||||||
|
|
||||||
// DICCIONARIO DE LOGOS
|
// DICCIONARIO DE LOGOS
|
||||||
|
// DICCIONARIO ACTUALIZADO CON ENLACES DINÁMICOS
|
||||||
const companyLogos = {
|
const companyLogos = {
|
||||||
'REPSOL': 'https://upload.wikimedia.org/wikipedia/commons/thumb/b/b3/Logo_Repsol.svg/1200px-Logo_Repsol.svg.png',
|
'REPSOL': 'https://upload.wikimedia.org/wikipedia/commons/thumb/b/b3/Logo_Repsol.svg/1200px-Logo_Repsol.svg.png',
|
||||||
'MUTUA': 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Mutua_Madrile%C3%B1a_Logo.svg/2560px-Mutua_Madrile%C3%B1a_Logo.svg.png',
|
'MUTUA': 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Mutua_Madrile%C3%B1a_Logo.svg/2560px-Mutua_Madrile%C3%B1a_Logo.svg.png',
|
||||||
@@ -168,13 +169,24 @@
|
|||||||
|
|
||||||
function getLogoUrl(companyName) {
|
function getLogoUrl(companyName) {
|
||||||
if (!companyName) return companyLogos['DEFAULT'];
|
if (!companyName) return companyLogos['DEFAULT'];
|
||||||
const name = companyName.toUpperCase();
|
|
||||||
|
// Normalizamos el nombre (quitamos prefijos como "HOME -" o "MULTI -")
|
||||||
|
const cleanName = companyName.toUpperCase()
|
||||||
|
.replace('HOME - ', '')
|
||||||
|
.replace('MULTI - ', '')
|
||||||
|
.trim();
|
||||||
|
|
||||||
|
// Buscamos la coincidencia parcial en el diccionario
|
||||||
for (const key in companyLogos) {
|
for (const key in companyLogos) {
|
||||||
if (name.includes(key)) return companyLogos[key];
|
if (cleanName.includes(key)) return companyLogos[key];
|
||||||
}
|
}
|
||||||
return companyLogos['DEFAULT'];
|
return companyLogos['DEFAULT'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CORRECCIÓN EN EL RENDERIZADO DEL LISTADO
|
||||||
|
// Asegúrate de que en loadInbox() la imagen tenga un onError para evitar el cuadro blanco
|
||||||
|
// card.innerHTML = `... <img src="${logoUrl}" onerror="this.src='${companyLogos['DEFAULT']}'" ...`;
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", async () => {
|
document.addEventListener("DOMContentLoaded", async () => {
|
||||||
if (!localStorage.getItem("token")) window.location.href = "index.html";
|
if (!localStorage.getItem("token")) window.location.href = "index.html";
|
||||||
setTimeout(async () => { await loadGuilds(); await loadInbox(); }, 200);
|
setTimeout(async () => { await loadGuilds(); await loadInbox(); }, 200);
|
||||||
|
|||||||
Reference in New Issue
Block a user