From 8ff9a84af416f9b9e791b74567d91635be5b1e82 Mon Sep 17 00:00:00 2001
From: ivarlovlie <git@ivarlovlie.no>
Date: Sun, 12 Jun 2022 14:26:40 +0200
Subject: refactor: Use store for setting current locale instead of directly
 setting a cookie

This was not doable before because locale.ts was inside of projects and not web-shared
---
 apps/web-shared/src/components/blowout-toolbelt.svelte | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

(limited to 'apps/web-shared/src/components/blowout-toolbelt.svelte')

diff --git a/apps/web-shared/src/components/blowout-toolbelt.svelte b/apps/web-shared/src/components/blowout-toolbelt.svelte
index b611a2d..2927d70 100644
--- a/apps/web-shared/src/components/blowout-toolbelt.svelte
+++ b/apps/web-shared/src/components/blowout-toolbelt.svelte
@@ -1,23 +1,16 @@
 <script>
-	import {createEventDispatcher} from "svelte";
 	import ThemeSwitcher from "./theme-switcher.svelte";
 	import ThemeSwitcherIcon from "./theme-switcher-icon.svelte";
 	import LocaleSwitcher from "./locale-switcher.svelte";
 	import LocaleSwitcherIcon from "./locale-switcher-icon.svelte";
-	import {ChevronsRightIcon, ChevronsLeftIcon} from "svelte-feather-icons";
-    
-	const dispatch = createEventDispatcher();
-	
-	function locale_change(event) {
-		dispatch("change", {name: "locale", value: event.detail})
-    }
-	
+	import { ChevronsRightIcon, ChevronsLeftIcon } from "svelte-feather-icons";
+
 	let expanded = false;
 	const localeSwitcher = {
 		show: false,
 		selection: "preffered"
 	};
-	
+
 	const themeSwitcher = {
 		show: false,
 		selection: "system"
@@ -35,7 +28,6 @@
 <aside class="blowout position-fixed bg-light inner-glow shadow-xs padding-xxs bottom-50% right-0 z-index-popover {expanded ? 'expanded' : ''}">
     <LocaleSwitcher bind:show="{localeSwitcher.show}"
                     glow="{false}"
-                    on:change={locale_change}
                     bind:selection="{localeSwitcher.selection}"/>
     <ThemeSwitcher bind:show="{themeSwitcher.show}"
                    glow="{false}"
-- 
cgit v1.3

