QR code viewer and content improvements
This commit is contained in:
parent
931b0806f9
commit
b8eae1fb54
|
@ -11,7 +11,7 @@ function Pass(): JSX.Element {
|
||||||
|
|
||||||
function closeViewer() {
|
function closeViewer() {
|
||||||
setFragment(undefined);
|
setFragment(undefined);
|
||||||
window.location.href = '/';
|
window.location.replace('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -19,12 +19,6 @@ function Pass(): JSX.Element {
|
||||||
const decodedFragment = Buffer.from(rawFragment, 'base64').toString();
|
const decodedFragment = Buffer.from(rawFragment, 'base64').toString();
|
||||||
setFragment(decodedFragment);
|
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', () => {
|
document.addEventListener('visibilitychange', () => {
|
||||||
if (document.hidden) {
|
if (document.hidden) {
|
||||||
closeViewer();
|
closeViewer();
|
||||||
|
@ -32,6 +26,8 @@ function Pass(): JSX.Element {
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEventListener('blur', closeViewer);
|
window.addEventListener('blur', closeViewer);
|
||||||
|
window.addEventListener('beforeunload', closeViewer);
|
||||||
|
window.addEventListener('pagehide', closeViewer);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -152,7 +152,7 @@ function Privacy(): JSX.Element {
|
||||||
<li>
|
<li>
|
||||||
{t('privacy:appleSync')}:
|
{t('privacy:appleSync')}:
|
||||||
|
|
||||||
<a href="https://www.apple.com/legal/privacy/en-ww/privacy.tsx" className="underline">
|
<a href="https://www.apple.com/legal/privacy/en-ww/" className="underline">
|
||||||
{t('common:privacyPolicy')}
|
{t('common:privacyPolicy')}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -3,9 +3,9 @@ import {Constants} from "./constants";
|
||||||
import {COLORS} from "./colors";
|
import {COLORS} from "./colors";
|
||||||
|
|
||||||
enum CertificateType {
|
enum CertificateType {
|
||||||
Vaccination = 'Vaccination Card',
|
Vaccination = 'Vaccination Pass',
|
||||||
Test = 'Test Certificate',
|
Test = 'Test Pass',
|
||||||
Recovery = 'Recovery Certificate',
|
Recovery = 'Recovery Pass',
|
||||||
}
|
}
|
||||||
|
|
||||||
enum TextAlignment {
|
enum TextAlignment {
|
||||||
|
|
Loading…
Reference in New Issue