Skip to content

Commit

Permalink
Merge pull request #147 from covidpass-org/dev
Browse files Browse the repository at this point in the history
QR code viewer and content improvements
  • Loading branch information
marvinsxtr authored Dec 29, 2021
2 parents e765408 + b8eae1f commit 9534a5d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
10 changes: 3 additions & 7 deletions pages/pass.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,23 @@ function Pass(): JSX.Element {

function closeViewer() {
setFragment(undefined);
window.location.href = '/';
window.location.replace('/');
}

useEffect(() => {
const rawFragment = window.location.hash.substring(1);
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();
}
});

window.addEventListener('blur', closeViewer);
window.addEventListener('beforeunload', closeViewer);
window.addEventListener('pagehide', closeViewer);
}, []);

return (
Expand Down
2 changes: 1 addition & 1 deletion pages/privacy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 3 additions & 3 deletions src/payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9534a5d

Please sign in to comment.