mirror of
https://github.com/smartyellow/status.git
synced 2025-01-18 05:27:58 +00:00
Suppress error
This commit is contained in:
parent
0c88920f9e
commit
0aa3ce6e2a
@ -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);
|
||||
|
@ -14,7 +14,7 @@ function createSettingsStore() {
|
||||
function updateStorage(val) {
|
||||
window.localStorage.setItem('statusdash', JSON.stringify({
|
||||
...defaults,
|
||||
...JSON.stringify(val),
|
||||
...val,
|
||||
}));
|
||||
s.set(val);
|
||||
}
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user