mirror of
https://github.com/covidpass-org/covidpass.git
synced 2025-02-17 12:10:45 +01:00
Increase timeout
This commit is contained in:
parent
7d930105d2
commit
685bbcb19b
@ -13,7 +13,6 @@ function Pass(): JSX.Element {
|
|||||||
|
|
||||||
const [fragment, setFragment] = useState<string>(undefined);
|
const [fragment, setFragment] = useState<string>(undefined);
|
||||||
const [view, setView] = useState<boolean>(true);
|
const [view, setView] = useState<boolean>(true);
|
||||||
const [resized, setResized] = useState<boolean>(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const rawFragment = window.location.hash.substring(1);
|
const rawFragment = window.location.hash.substring(1);
|
||||||
@ -23,13 +22,12 @@ function Pass(): JSX.Element {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const resizeTimeout = window.setTimeout(() => {
|
const resizeTimeout = window.setTimeout(() => {
|
||||||
if (!resized && rawFragment) {
|
if (rawFragment) {
|
||||||
window.location.replace('/pass/note');
|
window.location.replace('/pass/note');
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 200);
|
||||||
|
|
||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
setResized(true);
|
|
||||||
clearTimeout(resizeTimeout);
|
clearTimeout(resizeTimeout);
|
||||||
const decodedFragment = Buffer.from(rawFragment, 'base64').toString();
|
const decodedFragment = Buffer.from(rawFragment, 'base64').toString();
|
||||||
setFragment(decodedFragment);
|
setFragment(decodedFragment);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user