QR code viewer and content improvements

This commit is contained in:
Marvin Sextro 2021-12-29 03:29:07 +01:00
parent 931b0806f9
commit b8eae1fb54
3 changed files with 7 additions and 11 deletions

View File

@ -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 (

View File

@ -152,7 +152,7 @@ function Privacy(): JSX.Element {
<li>
{t('privacy:appleSync')}:
&nbsp;
<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')}
</a>
</li>

View File

@ -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 {