diff --git a/src/components/ErrorBoundary/index.tsx b/src/components/ErrorBoundary/index.tsx index c8b19bdaf5..8b773ab489 100644 --- a/src/components/ErrorBoundary/index.tsx +++ b/src/components/ErrorBoundary/index.tsx @@ -49,6 +49,11 @@ type ErrorBoundaryState = { const IS_UNISWAP = window.location.hostname === 'app.uniswap.org' +async function updateServiceWorker(): Promise { + const ready = await navigator.serviceWorker.ready + await ready.update() +} + export default class ErrorBoundary extends React.Component { constructor(props: unknown) { super(props) @@ -56,6 +61,13 @@ export default class ErrorBoundary extends React.Component { + window.location.reload() + }) + .catch((error) => { + console.error('Failed to update service worker', error) + }) return { error } }