diff --git a/pages/pass.tsx b/pages/pass.tsx index 863a154..1af5b0a 100644 --- a/pages/pass.tsx +++ b/pages/pass.tsx @@ -11,7 +11,7 @@ function Pass(): JSX.Element { function closeViewer() { setFragment(undefined); - window.location.href = '/'; + window.location.replace('/'); } useEffect(() => { @@ -19,12 +19,6 @@ function Pass(): JSX.Element { const decodedFragment = Buffer.from(rawFragment, 'base64').toString(); setFragment(decodedFragment); - window.location.replace('#'); - if (typeof window.history.replaceState == 'function') { - const href = window.location.href; - history.replaceState({}, '', href.slice(0, href.lastIndexOf('/'))); - } - document.addEventListener('visibilitychange', () => { if (document.hidden) { closeViewer(); @@ -32,6 +26,8 @@ function Pass(): JSX.Element { }); window.addEventListener('blur', closeViewer); + window.addEventListener('beforeunload', closeViewer); + window.addEventListener('pagehide', closeViewer); }, []); return ( diff --git a/pages/privacy.tsx b/pages/privacy.tsx index 13bd2f0..e450a74 100644 --- a/pages/privacy.tsx +++ b/pages/privacy.tsx @@ -152,7 +152,7 @@ function Privacy(): JSX.Element {
  • {t('privacy:appleSync')}:   - + {t('common:privacyPolicy')}
  • diff --git a/src/payload.ts b/src/payload.ts index e7c1f07..7500bbc 100644 --- a/src/payload.ts +++ b/src/payload.ts @@ -3,9 +3,9 @@ import {Constants} from "./constants"; import {COLORS} from "./colors"; enum CertificateType { - Vaccination = 'Vaccination Card', - Test = 'Test Certificate', - Recovery = 'Recovery Certificate', + Vaccination = 'Vaccination Pass', + Test = 'Test Pass', + Recovery = 'Recovery Pass', } enum TextAlignment {