Browse Source

refac: chat controls size

Timothy J. Baek 7 months ago
parent
commit
8fc178ae91

+ 5 - 5
src/lib/components/chat/Chat.svelte

@@ -289,11 +289,11 @@
 			if (controlPane && !$mobile) {
 				try {
 					if (value) {
-						controlPane.resize(
-							parseInt(localStorage.getItem('chat-controls-size') || '35')
-								? parseInt(localStorage.getItem('chat-controls-size') || '35')
-								: 35
-						);
+						const currentSize = controlPane.getSize();
+
+						if (currentSize === 0) {
+							controlPane.resize(parseInt(localStorage?.chatControlsSize ?? '30'));
+						}
 					} else {
 						controlPane.resize(0);
 					}

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

@@ -123,9 +123,7 @@
 		<Pane
 			bind:pane
 			defaultSize={$showControls
-				? parseInt(localStorage.getItem('chat-controls-size') || '35')
-					? parseInt(localStorage.getItem('chat-controls-size') || '35')
-					: 35
+				? controlPane.resize(parseInt(localStorage?.chatControlsSize ?? '30'))
 				: 0}
 			onResize={(size) => {
 				if (size === 0) {