Skip to content

Commit

Permalink
fix: localstorage related type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
anandbaburajan committed Apr 2, 2024
1 parent 115348f commit 54e9827
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pages/poll/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const Poll = (props: {
showVoteRecordedGroup = true;
} else {
votedTimeOneOnOne = JSON.parse(
Object.values(poll)[0].split("#")[1]
(Object.values(poll)[0] as string).split("#")[1]
);
showVoteRecordedOneOnOne = true;
}
Expand Down
7 changes: 4 additions & 3 deletions pages/recent-polls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,10 @@ const RecentPolls = (): JSX.Element => {
<Card className="your-polls-poll-card">
<Card.Body>
<Card.Title>
{Object.values(poll)[0].includes("#{") &&
(Object.values(poll)[0].split("#{")[0] || "Untitled")}
{!Object.values(poll)[0].includes("#{") &&
{(Object.values(poll)[0] as string).includes("#{") &&
((Object.values(poll)[0] as string).split("#{")[0] ||
"Untitled")}
{!(Object.values(poll)[0] as string).includes("#{") &&
(Object.values(poll)[0] || "Untitled")}
<div className="card-options">
<Button
Expand Down

0 comments on commit 54e9827

Please sign in to comment.