mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-06 13:14:11 +00:00
Revert "fix(frontend): reload page on Vite chunk preload error after upgrade"
This reverts commit bf0754d21e.
This commit is contained in:
parent
bf0754d21e
commit
120898ee09
10 changed files with 0 additions and 26 deletions
|
|
@ -2,7 +2,6 @@ import { createRoot } from 'react-dom/client';
|
|||
import { message } from 'antd';
|
||||
import 'antd/dist/reset.css';
|
||||
|
||||
import '@/utils/chunkReload';
|
||||
import { setupAxios } from '@/api/axios-init.js';
|
||||
import { applyDocumentTitle } from '@/utils';
|
||||
import { readyI18n } from '@/i18n/react';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { createRoot } from 'react-dom/client';
|
|||
import { message } from 'antd';
|
||||
import 'antd/dist/reset.css';
|
||||
|
||||
import '@/utils/chunkReload';
|
||||
import { setupAxios } from '@/api/axios-init.js';
|
||||
import { applyDocumentTitle } from '@/utils';
|
||||
import { readyI18n } from '@/i18n/react';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { createRoot } from 'react-dom/client';
|
|||
import { message } from 'antd';
|
||||
import 'antd/dist/reset.css';
|
||||
|
||||
import '@/utils/chunkReload';
|
||||
import { setupAxios } from '@/api/axios-init.js';
|
||||
import { applyDocumentTitle } from '@/utils';
|
||||
import { readyI18n } from '@/i18n/react';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { createRoot } from 'react-dom/client';
|
|||
import { message } from 'antd';
|
||||
import 'antd/dist/reset.css';
|
||||
|
||||
import '@/utils/chunkReload';
|
||||
import { setupAxios } from '@/api/axios-init.js';
|
||||
import { applyDocumentTitle } from '@/utils';
|
||||
import { readyI18n } from '@/i18n/react';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { createRoot } from 'react-dom/client';
|
|||
import { message } from 'antd';
|
||||
import 'antd/dist/reset.css';
|
||||
|
||||
import '@/utils/chunkReload';
|
||||
import { setupAxios } from '@/api/axios-init.js';
|
||||
import { applyDocumentTitle } from '@/utils';
|
||||
import { readyI18n } from '@/i18n/react';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { createRoot } from 'react-dom/client';
|
|||
import { message } from 'antd';
|
||||
import 'antd/dist/reset.css';
|
||||
|
||||
import '@/utils/chunkReload';
|
||||
import { setupAxios } from '@/api/axios-init.js';
|
||||
import { applyDocumentTitle } from '@/utils';
|
||||
import { readyI18n } from '@/i18n/react';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { createRoot } from 'react-dom/client';
|
|||
import { message } from 'antd';
|
||||
import 'antd/dist/reset.css';
|
||||
|
||||
import '@/utils/chunkReload';
|
||||
import { setupAxios } from '@/api/axios-init.js';
|
||||
import { applyDocumentTitle } from '@/utils';
|
||||
import { readyI18n } from '@/i18n/react';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { createRoot } from 'react-dom/client';
|
|||
import { message } from 'antd';
|
||||
import 'antd/dist/reset.css';
|
||||
|
||||
import '@/utils/chunkReload';
|
||||
import { readyI18n } from '@/i18n/react';
|
||||
import { ThemeProvider } from '@/hooks/useTheme';
|
||||
import SubPage from '@/pages/sub/SubPage';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { createRoot } from 'react-dom/client';
|
|||
import { message } from 'antd';
|
||||
import 'antd/dist/reset.css';
|
||||
|
||||
import '@/utils/chunkReload';
|
||||
import { setupAxios } from '@/api/axios-init.js';
|
||||
import { applyDocumentTitle } from '@/utils';
|
||||
import { readyI18n } from '@/i18n/react';
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
// After a panel upgrade the embedded dist/ ships with new hashed chunk
|
||||
// filenames, so an SPA that was loaded before the upgrade still holds
|
||||
// references to chunks that no longer exist on the server. The first
|
||||
// time a lazy import 404s we force a full reload so the browser picks
|
||||
// up the new index.html and its new chunk references.
|
||||
if (typeof window !== 'undefined') {
|
||||
const RELOAD_FLAG = '__xuiChunkReloadOnce';
|
||||
window.addEventListener('vite:preloadError', (event) => {
|
||||
event.preventDefault();
|
||||
if (sessionStorage.getItem(RELOAD_FLAG) === '1') return;
|
||||
sessionStorage.setItem(RELOAD_FLAG, '1');
|
||||
window.location.reload();
|
||||
});
|
||||
window.addEventListener('load', () => {
|
||||
sessionStorage.removeItem(RELOAD_FLAG);
|
||||
});
|
||||
}
|
||||
Loading…
Reference in a new issue