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 time = '';
|
||||||
let globalData = {};
|
let globalData = {};
|
||||||
let resizeTimer;
|
let resizeTimer;
|
||||||
|
let automaticallyProportionalised = false;
|
||||||
|
let hasData = false;
|
||||||
|
|
||||||
function onResize() {
|
function onResize() {
|
||||||
clearTimeout(resizeTimer);
|
clearTimeout(resizeTimer);
|
||||||
@ -26,7 +28,6 @@
|
|||||||
const tileH = 300;
|
const tileH = 300;
|
||||||
const availableCols = Math.floor(w / tileW);
|
const availableCols = Math.floor(w / tileW);
|
||||||
const availableRows = Math.floor(h / tileH);
|
const availableRows = Math.floor(h / tileH);
|
||||||
console.log(w, h, availableCols, availableRows);
|
|
||||||
|
|
||||||
settings.update({
|
settings.update({
|
||||||
cols: availableCols,
|
cols: availableCols,
|
||||||
@ -87,8 +88,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
proportionalGrid();
|
|
||||||
|
|
||||||
const ws = new WebSocket(
|
const ws = new WebSocket(
|
||||||
window.location.href.replace('http', 'ws') + '/socket'
|
window.location.href.replace('http', 'ws') + '/socket'
|
||||||
);
|
);
|
||||||
@ -100,6 +99,11 @@
|
|||||||
case 'data':
|
case 'data':
|
||||||
globalData = data;
|
globalData = data;
|
||||||
organiseGrid();
|
organiseGrid();
|
||||||
|
if (!automaticallyProportionalised) {
|
||||||
|
proportionalGrid();
|
||||||
|
automaticallyProportionalised = true;
|
||||||
|
}
|
||||||
|
hasData = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'bell':
|
case 'bell':
|
||||||
@ -119,7 +123,7 @@
|
|||||||
|
|
||||||
settings.subscribe(s => {
|
settings.subscribe(s => {
|
||||||
size = (s.cols || 4) * (s.rows || 3) - 1;
|
size = (s.cols || 4) * (s.rows || 3) - 1;
|
||||||
organiseGrid();
|
if (hasData) organiseGrid();
|
||||||
});
|
});
|
||||||
|
|
||||||
return () => clearInterval(clockInterval);
|
return () => clearInterval(clockInterval);
|
||||||
|
@ -14,7 +14,7 @@ function createSettingsStore() {
|
|||||||
function updateStorage(val) {
|
function updateStorage(val) {
|
||||||
window.localStorage.setItem('statusdash', JSON.stringify({
|
window.localStorage.setItem('statusdash', JSON.stringify({
|
||||||
...defaults,
|
...defaults,
|
||||||
...JSON.stringify(val),
|
...val,
|
||||||
}));
|
}));
|
||||||
s.set(val);
|
s.set(val);
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ async function build() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const { output } = await bundle.generate({
|
const { output } = await bundle.generate({
|
||||||
sourcemap: true,
|
sourcemap: false,
|
||||||
format: 'iife',
|
format: 'iife',
|
||||||
name: 'app',
|
name: 'app',
|
||||||
file: 'public/build/bundle.js',
|
file: 'public/build/bundle.js',
|
||||||
|
Loading…
Reference in New Issue
Block a user