Browse Source

enh: save chat controls width

Timothy J. Baek 7 months ago
parent
commit
98928f6bd7

+ 5 - 1
src/lib/components/chat/ChatControls.svelte

@@ -121,10 +121,14 @@
 		</PaneResizer>
 		<Pane
 			bind:pane
-			defaultSize={$showControls ? localStorage.getItem('chat-controls-size') || 40 : 0}
+			defaultSize={$showControls
+				? Math.max(parseInt(localStorage.getItem('chat-controls-size') || '35'), 35)
+				: 0}
 			onResize={(size) => {
 				if (size === 0) {
 					showControls.set(false);
+				} else if (size < 35) {
+					pane.resize(0);
 				} else {
 					if (!$showControls) {
 						showControls.set(true);

+ 3 - 1
src/lib/components/layout/Navbar.svelte

@@ -115,7 +115,9 @@
 
 								if (controlPane) {
 									if ($showControls) {
-										controlPane.resize(localStorage.getItem('chat-controls-size') || 40);
+										controlPane.resize(
+											Math.max(parseInt(localStorage.getItem('chat-controls-size') || '35'), 35)
+										);
 									} else {
 										controlPane.resize(0);
 									}