chore(svelte): prevent undefined for width and height

This commit is contained in:
moklick
2023-10-30 11:14:10 +01:00
parent d1662f1703
commit bbdff5ab10

View File

@@ -108,8 +108,10 @@
// Update width & height on resize
$: {
store.width.set(clientWidth);
store.height.set(clientHeight);
if (clientWidth !== undefined && clientHeight !== undefined) {
store.width.set(clientWidth);
store.height.set(clientHeight);
}
}
// this updates the store for simple changes