Compare commits
1 Commits
fix-image-
...
fix-back-b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2a41df96e |
@@ -51,8 +51,12 @@ export function BackRouteHandler({ children }: BackRouteHandlerProps) {
|
|||||||
},
|
},
|
||||||
location.pathname
|
location.pathname
|
||||||
);
|
);
|
||||||
if (spaceMatch?.params.spaceIdOrAlias) {
|
const encodedSpaceIdOrAlias = spaceMatch?.params.spaceIdOrAlias;
|
||||||
navigate(getSpacePath(spaceMatch.params.spaceIdOrAlias));
|
const decodedSpaceIdOrAlias =
|
||||||
|
encodedSpaceIdOrAlias && decodeURIComponent(encodedSpaceIdOrAlias);
|
||||||
|
|
||||||
|
if (decodedSpaceIdOrAlias) {
|
||||||
|
navigate(getSpacePath(decodedSpaceIdOrAlias));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -27,24 +27,10 @@ if ('serviceWorker' in navigator) {
|
|||||||
? `${trimTrailingSlash(import.meta.env.BASE_URL)}/sw.js`
|
? `${trimTrailingSlash(import.meta.env.BASE_URL)}/sw.js`
|
||||||
: `/dev-sw.js?dev-sw`;
|
: `/dev-sw.js?dev-sw`;
|
||||||
|
|
||||||
const sendSessionToSW = () => {
|
navigator.serviceWorker.register(swUrl).then(() => {
|
||||||
const session = getFallbackSession();
|
const session = getFallbackSession();
|
||||||
pushSessionToSW(session?.baseUrl, session?.accessToken);
|
pushSessionToSW(session?.baseUrl, session?.accessToken);
|
||||||
};
|
|
||||||
|
|
||||||
navigator.serviceWorker.register(swUrl).then(sendSessionToSW);
|
|
||||||
navigator.serviceWorker.ready.then(sendSessionToSW);
|
|
||||||
window.addEventListener('load', sendSessionToSW);
|
|
||||||
|
|
||||||
// When returning from background
|
|
||||||
document.addEventListener('visibilitychange', () => {
|
|
||||||
if (document.visibilityState === 'visible') {
|
|
||||||
sendSessionToSW();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// When restored from bfcache (important on iOS)
|
|
||||||
window.addEventListener('pageshow', sendSessionToSW);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const mountApp = () => {
|
const mountApp = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user