Suppress error

This commit is contained in:
Romein van Buren 2022-07-13 12:23:54 +02:00
parent 0c88920f9e
commit 0aa3ce6e2a
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
3 changed files with 10 additions and 6 deletions

View File

@ -12,6 +12,8 @@
let time = '';
let globalData = {};
let resizeTimer;
let automaticallyProportionalised = false;
let hasData = false;
function onResize() {
clearTimeout(resizeTimer);
@ -26,7 +28,6 @@
const tileH = 300;
const availableCols = Math.floor(w / tileW);
const availableRows = Math.floor(h / tileH);
console.log(w, h, availableCols, availableRows);
settings.update({
cols: availableCols,
@ -87,8 +88,6 @@
}
onMount(() => {
proportionalGrid();
const ws = new WebSocket(
window.location.href.replace('http', 'ws') + '/socket'
);
@ -100,6 +99,11 @@
case 'data':
globalData = data;
organiseGrid();
if (!automaticallyProportionalised) {
proportionalGrid();
automaticallyProportionalised = true;
}
hasData = true;
break;
case 'bell':
@ -119,7 +123,7 @@
settings.subscribe(s => {
size = (s.cols || 4) * (s.rows || 3) - 1;
organiseGrid();
if (hasData) organiseGrid();
});
return () => clearInterval(clockInterval);

View File

@ -14,7 +14,7 @@ function createSettingsStore() {
function updateStorage(val) {
window.localStorage.setItem('statusdash', JSON.stringify({
...defaults,
...JSON.stringify(val),
...val,
}));
s.set(val);
}

View File

@ -40,7 +40,7 @@ async function build() {
});
const { output } = await bundle.generate({
sourcemap: true,
sourcemap: false,
format: 'iife',
name: 'app',
file: 'public/build/bundle.js',