fix(share): The language of the shared page will cause the language of the original website to change. (#18043)

This commit is contained in:
chanx
2026-08-10 17:26:18 +08:00
committed by GitHub
parent d6292da508
commit 5a2cd36b45
8 changed files with 44 additions and 47 deletions

View File

@@ -1,6 +1,5 @@
import { Toaster as Sonner } from '@/components/ui/sonner';
import { Toaster } from '@/components/ui/toaster';
import { changeLanguageAsync } from '@/locales/config';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { configResponsive } from 'ahooks';
import dayjs from 'dayjs';
@@ -13,13 +12,12 @@ import localeData from 'dayjs/plugin/localeData';
import weekOfYear from 'dayjs/plugin/weekOfYear';
import weekYear from 'dayjs/plugin/weekYear';
import weekday from 'dayjs/plugin/weekday';
import React, { useEffect } from 'react';
import React from 'react';
import { RouterProvider } from 'react-router';
import { ThemeProvider } from './components/theme-provider';
import { TooltipProvider } from './components/ui/tooltip';
import { ThemeEnum } from './constants/common';
import { routers } from './routes';
import storage from './utils/authorization-util';
import 'react-photo-view/dist/react-photo-view.css';
@@ -76,13 +74,6 @@ function Root({ children }: React.PropsWithChildren) {
}
const RootProvider = ({ children }: React.PropsWithChildren) => {
useEffect(() => {
const lng = storage.getLanguage();
if (lng) {
void changeLanguageAsync(lng);
}
}, []);
return (
<TooltipProvider>
<QueryClientProvider client={queryClient}>