From 9d9ff0fce5bedcfe42d65d032aba4f4aec9653dc Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 21 Jan 2024 02:51:25 -0800
Subject: fix(layout): locale reactivity

---
 src/lib/Settings/SettingCheckboxToggle.svelte | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'src/lib/Settings/SettingCheckboxToggle.svelte')

diff --git a/src/lib/Settings/SettingCheckboxToggle.svelte b/src/lib/Settings/SettingCheckboxToggle.svelte
index 87f5b330..a2af0d25 100644
--- a/src/lib/Settings/SettingCheckboxToggle.svelte
+++ b/src/lib/Settings/SettingCheckboxToggle.svelte
@@ -8,7 +8,7 @@
 
 	export let sectionBreak = false;
 	export let disabled = false;
-	export let text: string;
+	export let text: string | (() => string);
 	export let setting: SettingsBooleanKeys[keyof SettingsBooleanKeys];
 	export let lineBreak = true;
 	export let onChange: () => void = () => {
@@ -17,6 +17,7 @@
 	export let invert = false;
 
 	$: checked = invert ? !$settings[setting] : $settings[setting];
+	$: field = text instanceof Function ? text() : text;
 
 	// const toggler = (key: keyof Settings) => [
 	// 	() =>
@@ -58,11 +59,11 @@
 >
 	{#if disabled}
 		<strike>
-			{@html text}
+			{field}
 		</strike>
 		<slot />
 	{:else}
-		{@html text}
+		{field}
 		<slot />
 	{/if}
 </span>
-- 
cgit v1.2.3

