From 27f1a01deb42b4dda83e5d6427e5e545cf09f199 Mon Sep 17 00:00:00 2001 From: kadiryazici Date: Sun, 24 Sep 2023 18:35:37 +0300 Subject: [PATCH] Remove stupid ref --- src/composables/useI18n.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/composables/useI18n.ts b/src/composables/useI18n.ts index c793cac..1136c3c 100644 --- a/src/composables/useI18n.ts +++ b/src/composables/useI18n.ts @@ -1,5 +1,5 @@ import { createSharedComposable, reactiveComputed } from '@vueuse/core' -import { Fragment, customRef, h, ref } from 'vue' +import { Fragment, customRef, h } from 'vue' import { AppStorage } from '../storage' import { type NotificationReason } from '../constants' @@ -143,15 +143,15 @@ const localeMap: Record = { en, tr } export const useI18n = createSharedComposable(() => { const currentLanguage = customRef((track, trigger) => { - const locale = ref(AppStorage.get('language')) + let locale: Locale = AppStorage.get('language') return { get() { track() - return locale.value + return locale }, set(value) { - locale.value = value + locale = value AppStorage.set('language', value) trigger() },