Skip to content

Commit

Permalink
fix(guest): improve condition URL
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Dec 20, 2024
1 parent fbfaa83 commit 90a5a65
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions js/guest.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const guest = (() => {
const raw = window.location.search.split('to=');
let name = null;

if (raw.length > 1 && raw[1].length > 0) {
if (raw.length >= 2 && raw[1].length > 0) {
name = decodeURIComponent(raw[1]);

const guest = document.getElementById('guest-name');
Expand Down Expand Up @@ -116,6 +116,7 @@ export const guest = (() => {

theme.spyTop();
theme.showButtonChangeTheme();

util.timeOut(animation, 1500);
};

Expand All @@ -133,8 +134,9 @@ export const guest = (() => {
storage('tracker').clear();
}

if (information.get('presence') !== undefined) {
document.getElementById('form-presence').value = information.get('presence') ? '1' : '2';
const presence = information.get('presence');
if (presence !== undefined) {
document.getElementById('form-presence').value = presence ? '1' : '2';
}

const info = document.getElementById('information');
Expand Down

0 comments on commit 90a5a65

Please sign in to comment.