diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..7b016a8
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "java.compile.nullAnalysis.mode": "automatic"
+}
\ No newline at end of file
diff --git a/frontend/js/codigo.js b/frontend/js/codigo.js
index b9be52c..b56ef4d 100644
--- a/frontend/js/codigo.js
+++ b/frontend/js/codigo.js
@@ -24,9 +24,8 @@ if (document.readyState === 'loading') {
VARIABLES GLOBALES
============================================ */
-let fechaHoyElem, indicadorLiturgicoElem, cabeceraHoy, menuPrincipalElem,
- nombreCicloElem, cicloParImparElem, descripcionSantoDelDiaElem,
- errorElem, salmoDelDiaElem;
+// Las variables globales comunes (fechaHoyElem, etc.) se declaran en header.js
+let salmoDelDiaElem;
@@ -74,8 +73,17 @@ async function visualizarSalmo() {
}
} catch (e) {
- console.error("Error cargando el salmo:", e);
- salmoElem.textContent = "Bendice, alma mía, al Señor.";
+ console.warn("API no disponible, cargando salmo local:", e);
+ try {
+ const res2 = await fetch('data/salmos.json');
+ const salmos = await res2.json();
+ const hoy = new Date();
+ const diaAnyo = Math.floor((hoy - new Date(hoy.getFullYear(), 0, 0)) / 86400000);
+ const salmo = salmos[diaAnyo % salmos.length];
+ salmoElem.innerHTML = `${salmo.texto}
— Salmo ${salmo.numero}`;
+ } catch (e2) {
+ salmoElem.textContent = "Bendice, alma mía, al Señor.";
+ }
}
}