From 7e938138ffaa10e40e01eeab7e2e768fbec41325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Tue, 24 Feb 2026 11:02:17 +0100 Subject: [PATCH] fix sidebar width, v0.1.5 --- package.json | 2 +- src/panels/useSidePanelMachine.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 25faaab..de48017 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@panic/web-core", - "version": "0.1.4", + "version": "0.1.5", "license": "AGPL-3.0-only", "description": "Core auth and utilities for panic.haus web applications", "type": "module", diff --git a/src/panels/useSidePanelMachine.ts b/src/panels/useSidePanelMachine.ts index 6406283..488ea44 100644 --- a/src/panels/useSidePanelMachine.ts +++ b/src/panels/useSidePanelMachine.ts @@ -76,6 +76,10 @@ export function useSidePanelMachine({ } const storedValue = localStorage.getItem(storageKey); + if (storedValue == null || storedValue.trim() === '') { + return defaultWidth; + } + const parsed = Number(storedValue); if (!Number.isFinite(parsed)) { return defaultWidth;