Skip to content

Commit

Permalink
Go to the correct screen
Browse files Browse the repository at this point in the history
  • Loading branch information
urielsalis committed Nov 22, 2023
1 parent 988011b commit 42b2dae
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions components/apps/me.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,12 @@ export class AboutUriel extends Component {
"talks": <Talks />,
"resume": <Resume />,
}

let lastVisitedScreen = localStorage.getItem("about-section");
if (lastVisitedScreen === null || lastVisitedScreen === undefined) {
lastVisitedScreen = this.props.default;
}

// focus last visited screen
this.changeScreen(document.getElementById(lastVisitedScreen));
this.changeScreen(document.getElementById(this.active_screen));
}

changeScreen = (e) => {
const screen = e.id || e.target.id;

// store this state
localStorage.setItem("about-section", screen);

// google analytics
ReactGA.send({ hitType: "pageview", page: `/${screen}`, title: "Custom Title" });

Expand Down

0 comments on commit 42b2dae

Please sign in to comment.