fix: PWA-Update-Banner nach Reload zuverlässig ausblenden

needRefresh zurücksetzen, Reload-Fallback ergänzen und kurze Suppression nach Update,
damit die Benachrichtigung nicht erneut erscheint.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-29 18:33:43 +02:00
co-authored by Cursor
parent 66a32e0367
commit 268500237d
2 changed files with 54 additions and 9 deletions
+5 -6
View File
@@ -5,17 +5,16 @@ import { usePwaUpdate } from '../hooks/usePwaUpdate.js'
export default function PwaUpdatePrompt() {
const { t } = useTranslation()
const { needRefresh, updateApp } = usePwaUpdate()
const { needRefresh, updateApp, dismissUpdate } = usePwaUpdate()
const [updating, setUpdating] = useState(false)
const [dismissed, setDismissed] = useState(false)
if (!needRefresh || dismissed) return null
if (!needRefresh) return null
const handleUpdate = async () => {
setUpdating(true)
try {
await updateApp()
} finally {
} catch {
setUpdating(false)
}
}
@@ -43,7 +42,7 @@ export default function PwaUpdatePrompt() {
<button
type="button"
className="pwa-update-link"
onClick={() => setDismissed(true)}
onClick={dismissUpdate}
>
{t('pwa.later')}
</button>
@@ -52,7 +51,7 @@ export default function PwaUpdatePrompt() {
<button
type="button"
className="pwa-update-close"
onClick={() => setDismissed(true)}
onClick={dismissUpdate}
aria-label={t('pwa.later')}
>
<X size={18} />