Skip to content

Commit

Permalink
Remove stupid ref
Browse files Browse the repository at this point in the history
  • Loading branch information
kadiryazici committed Sep 24, 2023
1 parent bc88589 commit 27f1a01
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/composables/useI18n.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down Expand Up @@ -143,15 +143,15 @@ const localeMap: Record<Locale, typeof en> = { en, tr }

export const useI18n = createSharedComposable(() => {
const currentLanguage = customRef<Locale>((track, trigger) => {
const locale = ref<Locale>(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()
},
Expand Down

0 comments on commit 27f1a01

Please sign in to comment.