feat(admin): reload once when a chunk fails to load after a deploy (quick-261028-rqb)
- installChunkReloadGuard reloads on vite:preloadError, at most once per 60 s through a sessionStorage timestamp; no storage means no reload
This commit is contained in:
@@ -3,6 +3,7 @@ import App from './App.vue'
|
||||
import { createAdminRouter } from './app/router'
|
||||
import { onUnauthorized } from './api/client'
|
||||
import { startBuildWatch } from './app/buildUpdate'
|
||||
import { installChunkReloadGuard } from './app/chunkReload'
|
||||
import { loadFieldTypes } from './app/fieldTypes'
|
||||
import { loadStrings } from './app/i18n'
|
||||
import { expireSession, me } from './state/useAuth'
|
||||
@@ -12,6 +13,8 @@ import { loadSettings } from './state/useSettings'
|
||||
import './styles/main.css'
|
||||
|
||||
async function boot(): Promise<void> {
|
||||
// A chunk that fails to load after a deploy reloads the page once.
|
||||
installChunkReloadGuard()
|
||||
// The last theme choice (system unless the admin picked light or dark) is
|
||||
// applied before the first await, so nothing renders in the wrong theme;
|
||||
// me() then applies the admin's stored preference.
|
||||
|
||||
Reference in New Issue
Block a user