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:
@@ -115,16 +115,14 @@ export function usePwaUpdate() {
|
|||||||
setNeedRefreshRef.current = setNeedRefresh
|
setNeedRefreshRef.current = setNeedRefresh
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (pendingNeedRefreshRef.current !== null) {
|
if (isUpdateSuppressed()) {
|
||||||
|
setNeedRefresh(false)
|
||||||
|
} else if (pendingNeedRefreshRef.current !== null) {
|
||||||
const pending = pendingNeedRefreshRef.current
|
const pending = pendingNeedRefreshRef.current
|
||||||
pendingNeedRefreshRef.current = null
|
pendingNeedRefreshRef.current = null
|
||||||
setNeedRefresh(pending)
|
setNeedRefresh(pending)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isUpdateSuppressed()) {
|
|
||||||
setNeedRefresh(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
void isDeployedVersionNewer().then((outdated) => {
|
void isDeployedVersionNewer().then((outdated) => {
|
||||||
if (outdated) {
|
if (outdated) {
|
||||||
setNeedRefresh(true)
|
setNeedRefresh(true)
|
||||||
|
|||||||
Reference in New Issue
Block a user