fix(pwa): Pending-Refresh bei Suppression nicht sofort verwerfen

Suppression wird vor dem Flush geprüft, damit gepufferte
needRefresh-Werte erhalten bleiben, bis die Unterdrückung endet.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-31 14:46:02 +02:00
parent 61675e1085
commit 58984594b0
+3 -5
View File
@@ -115,16 +115,14 @@ export function usePwaUpdate() {
setNeedRefreshRef.current = setNeedRefresh
useEffect(() => {
if (pendingNeedRefreshRef.current !== null) {
if (isUpdateSuppressed()) {
setNeedRefresh(false)
} else if (pendingNeedRefreshRef.current !== null) {
const pending = pendingNeedRefreshRef.current
pendingNeedRefreshRef.current = null
setNeedRefresh(pending)
}
if (isUpdateSuppressed()) {
setNeedRefresh(false)
}
void isDeployedVersionNewer().then((outdated) => {
if (outdated) {
setNeedRefresh(true)