disable ios pwa prompt for more than a single page in #953

This commit is contained in:
keyan 2024-03-25 20:46:51 -05:00
parent d15e060ff3
commit dcc81c8b03

View File

@ -76,6 +76,14 @@ export default function MyApp ({ Component, pageProps: { ...props } }) {
}
}, [router.asPath, props?.apollo])
useEffect(() => {
// hack to disable ios pwa prompt for https://github.com/stackernews/stacker.news/issues/953
// see https://github.com/chrisdancee/react-ios-pwa-prompt/blob/66e91c4f033b740cff42c3220cf13ebdf39e3078/src/index.js#L30
if (router?.query?.disablePrompt) {
localStorage.setItem("iosPwaPrompt", JSON.stringify({ isiOS: false, visits: 0 }))
}
}, [router?.query?.disablePrompt])
/*
If we are on the client, we populate the apollo cache with the
ssr data