fix the rest of warnings

This commit is contained in:
Martti Malmi
2024-01-10 20:16:30 +02:00
parent e6a42db658
commit 5baffd00b9
37 changed files with 415 additions and 390 deletions

View File

@ -2,7 +2,7 @@ import { ReactNode, useEffect, useState } from "react";
import { IntlProvider as ReactIntlProvider } from "react-intl";
import { DefaultLocale } from "@/Components/IntlProvider/IntlProviderUtils";
import {useLocale} from "@/Components/IntlProvider/useLocale";
import { useLocale } from "@/Components/IntlProvider/useLocale";
import enMessages from "@/translations/en.json";
const getMessages = (locale: string) => {

View File

@ -1,4 +1,4 @@
import {ExternalStore} from "@snort/shared";
import { ExternalStore } from "@snort/shared";
class LangStore extends ExternalStore<string | null> {
setLang(s: string) {
@ -11,4 +11,4 @@ class LangStore extends ExternalStore<string | null> {
}
}
export const LangOverride = new LangStore();
export const LangOverride = new LangStore();

View File

@ -1,11 +1,11 @@
import {useSyncExternalStore} from "react";
import { useSyncExternalStore } from "react";
import {getLocale} from "@/Components/IntlProvider/IntlProviderUtils";
import {LangOverride} from "@/Components/IntlProvider/langStore";
import { getLocale } from "@/Components/IntlProvider/IntlProviderUtils";
import { LangOverride } from "@/Components/IntlProvider/langStore";
import useLogin from "@/Hooks/useLogin";
export function useLocale() {
const {language} = useLogin(s => ({language: s.appData.item.preferences.language}));
const { language } = useLogin(s => ({ language: s.appData.item.preferences.language }));
const loggedOutLang = useSyncExternalStore(
c => LangOverride.hook(c),
() => LangOverride.snapshot(),
@ -16,4 +16,4 @@ export function useLocale() {
lang: locale.toLowerCase().split(/[_-]+/)[0],
setOverride: (s: string) => LangOverride.setLang(s),
};
}
}