Skip to content

Commit

Permalink
Update reload.ts
Browse files Browse the repository at this point in the history
speculative fix for redirect failures
  • Loading branch information
schlawg authored Jul 19, 2023
1 parent 5e2557b commit 0fd4534
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ui/site/src/component/reload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ interface Opts {
}

export const redirect = async (opts: string | Opts, notify?: 'countdown' | 'beep') => {
if (notify === 'countdown') await lichess.sound.countdown(3);
else if (notify === 'beep') await lichess.sound.play('genericNotify');

try {
if (notify === 'countdown') await lichess.sound.countdown(3);
else if (notify === 'beep') await lichess.sound.play('genericNotify');
} catch (e) {
console.warn(e);
}
let url: string;
if (typeof opts == 'string') url = opts;
else {
Expand Down

0 comments on commit 0fd4534

Please sign in to comment.