debug variable

This commit is contained in:
Alexander Popov 2023-08-03 23:43:38 +03:00
parent 957bdda3ab
commit 902890c966
Signed by: iiiypuk
GPG Key ID: E47FE0AB36CD5ED6
2 changed files with 12 additions and 2 deletions

View File

@ -1,5 +1,8 @@
import { routes } from './routes.js'; import { routes } from './routes.js';
let DEBUG = true;
window.DEBUG = DEBUG;
/* main */ /* main */
window.onload = function () { window.onload = function () {
let app = document.documentElement; let app = document.documentElement;

View File

@ -24,8 +24,15 @@
import { update_lastfm_nowplay } from './js/lastfm-nowplay.js'; import { update_lastfm_nowplay } from './js/lastfm-nowplay.js';
function autorun() { function autorun() {
update_lastfm_nowplay(); if (!window.DEBUG) {
setInterval(autorun, 120_000); // 2 minutes update_lastfm_nowplay();
setInterval(autorun, 120_000); // 2 minutes
} else {
console.log(
'INFO! Включена отладка, заскробленная композиция не загружается!\n' +
'Файл personal.html',
);
}
} }
autorun(); autorun();
</script> </script>