shinkan-jinkendo/frontend/src/utils/lazyWithRetry.js
Lars 8718cf5c70
Some checks failed
Deploy Development / deploy (push) Successful in 43s
Test Suite / pytest-backend (push) Successful in 42s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 14s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Failing after 1m15s
Enhance Authentication and Feature Usage Handling
- Refactored the logout function in AuthContext to handle asynchronous logout operations, improving session management.
- Updated the FeatureUsageBadge component to display error messages when feature data retrieval fails, enhancing user feedback.
- Replaced lazy loading of OnboardingPage with lazyWithRetry for improved loading reliability.
- Adjusted the EntitlementsContext to determine club ID using utility functions for better governance form handling.
2026-06-07 07:05:02 +02:00

21 lines
518 B
JavaScript

import { lazy } from 'react'
/**
* Lazy-Import mit Reload bei fehlendem Chunk (nach Deploy alte Hashes im Browser-Cache).
*/
export function lazyWithRetry(importFn) {
return lazy(() =>
importFn().catch((err) => {
const key = 'sj_chunk_reload'
const reloaded = sessionStorage.getItem(key)
if (!reloaded) {
sessionStorage.setItem(key, '1')
window.location.reload()
return new Promise(() => {})
}
sessionStorage.removeItem(key)
throw err
}),
)
}