Browse Source

settings fix -> updates value directly

Jannik Streidl 1 year ago
parent
commit
06f53a6882

+ 3 - 0
src/lib/components/chat/Settings/Interface.svelte

@@ -32,6 +32,9 @@
 
 
 	const toggleenableWhatsChanged = async () => {
 	const toggleenableWhatsChanged = async () => {
 		enableWhatsChanged = !enableWhatsChanged;
 		enableWhatsChanged = !enableWhatsChanged;
+		if (enableWhatsChanged) {
+			showWhatsChanged.update((value) => true);
+		}
 		saveSettings({ enableWhatsChanged: enableWhatsChanged });
 		saveSettings({ enableWhatsChanged: enableWhatsChanged });
 	};
 	};
 
 

+ 9 - 3
src/lib/components/chat/WhatsChangedModal.svelte

@@ -4,19 +4,25 @@
 	import { WEBUI_NAME, WEB_UI_VERSION, RELEASE_NOTES } from '$lib/constants';
 	import { WEBUI_NAME, WEB_UI_VERSION, RELEASE_NOTES } from '$lib/constants';
 	import { config, showWhatsChanged } from '$lib/stores';
 	import { config, showWhatsChanged } from '$lib/stores';
 
 
+	export let show = false;
+
 	function toggleVisibility() {
 	function toggleVisibility() {
 		showWhatsChanged.update((value) => !value);
 		showWhatsChanged.update((value) => !value);
 	}
 	}
+
+	function handleClick() {
+		toggleVisibility();
+	}
 </script>
 </script>
 
 
-<Modal>
+<Modal bind:show>
 	<div class="px-5 py-4 dark:text-gray-300">
 	<div class="px-5 py-4 dark:text-gray-300">
 		<div class="flex justify-between items-start">
 		<div class="flex justify-between items-start">
 			<div class="text-xl font-bold">
 			<div class="text-xl font-bold">
 				{WEBUI_NAME}
 				{WEBUI_NAME}
 				<Confetti x={[-1, -0.25]} y={[0, 0.5]} />
 				<Confetti x={[-1, -0.25]} y={[0, 0.5]} />
 			</div>
 			</div>
-			<button class="self-center" on:click={toggleVisibility}>
+			<button class="self-center" on:click={handleClick}>
 				<svg
 				<svg
 					xmlns="http://www.w3.org/2000/svg"
 					xmlns="http://www.w3.org/2000/svg"
 					viewBox="0 0 20 20"
 					viewBox="0 0 20 20"
@@ -58,7 +64,7 @@
 		</div>
 		</div>
 		<div class="m-4 flex justify-end pt-3 text-sm font-medium">
 		<div class="m-4 flex justify-end pt-3 text-sm font-medium">
 			<button
 			<button
-				on:click={toggleVisibility}
+				on:click={handleClick}
 				class=" rounded px-4 py-2 overflow-hidden group bg-green-600 relative hover:bg-gradient-to-r hover:from-green-600 hover:to-green-500 text-white hover:ring-2 hover:ring-offset-2 hover:ring-green-500 transition-all ease-out duration-300"
 				class=" rounded px-4 py-2 overflow-hidden group bg-green-600 relative hover:bg-gradient-to-r hover:from-green-600 hover:to-green-500 text-white hover:ring-2 hover:ring-offset-2 hover:ring-green-500 transition-all ease-out duration-300"
 			>
 			>
 				<span
 				<span