Skip to content

Commit

Permalink
Remember last schedule starred view
Browse files Browse the repository at this point in the history
Signed-off-by: Kowalski Dragon (kowalski7cc) <kowalski7cc@users.noreply.github.com>
  • Loading branch information
kowalski7cc committed Oct 23, 2023
1 parent 4a932ef commit ec21dc9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/schedule.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ const Page = ({ data }) => {

useEffect(() => {
let current = localStorage.getItem("starredTalks");
let showStarred = localStorage.getItem("showStarred");
if (showStarred === "true") {
setShowStarred(true);
}
if (current) {
try {
current = JSON.parse(current);
Expand Down Expand Up @@ -256,7 +260,7 @@ const Page = ({ data }) => {
<div className='d-flex flex-row gap-3 d-print-none'>
<Button
variant='warning'
onClick={() => setShowStarred((curr) => !curr)}
onClick={() => {setShowStarred((curr) => !curr); localStorage.setItem("showStarred", !showStarred)}}
>
{showStarred ? "Tutte le talk" : "Agenda personale"}
</Button>
Expand Down

0 comments on commit ec21dc9

Please sign in to comment.