Fix PWA-Update: window global statt dynamic import, synchroner Reload bei Seitenwechsel

This commit is contained in:
2026-06-02 19:38:40 +02:00
parent b698818791
commit b0b4c27f00
3 changed files with 26 additions and 41 deletions

View File

@@ -2383,7 +2383,10 @@ export default function App() {
const [user,setUser]=useState(null);
const [active,setActiveRaw]=useState('dashboard');
const setActive = (page) => {
import('./main.jsx').then(m => m.reloadIfNewBuild?.()).catch(()=>{});
if (window.__newBuildAvailable) {
window.location.reload();
return; // kein Rendern mehr, Reload läuft
}
setActiveRaw(page);
};
const [toastMsg,setToastMsg]=useState({msg:'',type:'success'});