Merge pull request #929 from SuanmoSuanyangTechnology/fix/web_cache_zy
fix(web): After a new release, old dynamic chunk files are deleted; f…
This commit is contained in:
@@ -126,7 +126,6 @@ const PageScrollList = forwardRef(<T, Q = Record<string, unknown>>({
|
|||||||
// 内容不足以填满容器时,主动继续加载
|
// 内容不足以填满容器时,主动继续加载
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const el = scrollRef.current;
|
const el = scrollRef.current;
|
||||||
console.log(el, el?.scrollHeight, el?.clientHeight, hasMoreRef.current)
|
|
||||||
if (el && hasMoreRef.current && el.scrollHeight <= el.clientHeight) {
|
if (el && hasMoreRef.current && el.scrollHeight <= el.clientHeight) {
|
||||||
loadMoreData();
|
loadMoreData();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* @Author: ZhaoYing
|
||||||
|
* @Date: 2025-12-02 20:28:01
|
||||||
|
* @Last Modified by: ZhaoYing
|
||||||
|
* @Last Modified time: 2026-04-17 14:19:14
|
||||||
|
*/
|
||||||
import { createRoot } from 'react-dom/client'
|
import { createRoot } from 'react-dom/client'
|
||||||
import '@/styles/index.css'
|
import '@/styles/index.css'
|
||||||
import App from '@/App.tsx'
|
import App from '@/App.tsx'
|
||||||
|
|
||||||
// 同步导入i18n配置以确保在组件渲染前初始化完成
|
// Synchronously import i18n config to ensure initialization before component rendering
|
||||||
import './i18n'
|
import './i18n'
|
||||||
|
|
||||||
|
// After a new release, old dynamic chunk files are deleted; force a page reload on preload error
|
||||||
|
window.addEventListener('vite:preloadError', () => {
|
||||||
|
console.warn('New version detected, reloading page to load latest assets...')
|
||||||
|
window.location.reload()
|
||||||
|
})
|
||||||
|
|
||||||
createRoot(document.getElementById('root')!)
|
createRoot(document.getElementById('root')!)
|
||||||
.render(
|
.render(
|
||||||
<App />
|
<App />
|
||||||
|
|||||||
Reference in New Issue
Block a user