Skip to content

Commit

Permalink
🐛 Bug Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AJR07 committed Sep 15, 2023
1 parent bda0ad7 commit 6e1fa6a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/routes/[start]/[end]/[title]/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ export function load({ params }: { params: any }): {
body: "undefined" | Countdown;
} {
if (browser) {
let countdowns: Data = JSON.parse(localStorage.getItem("countdowns")!);
let countdowns: Data =
localStorage.getItem("countdowns") !== null
? JSON.parse(localStorage.getItem("countdowns")!)
: {
Example: {
title: "Example",
start: new Date("2000-01-01"),
end: new Date("2100-01-01"),
},
};
let title = params.title,
start = parseInt(params.start)!,
end = parseInt(params.end)!;
Expand Down

0 comments on commit 6e1fa6a

Please sign in to comment.