Skip to content

Commit

Permalink
🐛 fix(app): adjust start button redirect with react router hook
Browse files Browse the repository at this point in the history
  • Loading branch information
gerdesque committed Feb 26, 2024
1 parent b0c4015 commit 069b4a1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Start.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { Block, Button, Navbar, Page, Popup } from "konsta/react";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom";
import { Link, useNavigate } from "react-router-dom";

import useStore from "../store";
import CollageIcon from "/collage.webp";
Expand Down Expand Up @@ -31,6 +31,7 @@ const Collage = () => {

function Start() {
const { t } = useTranslation();
const navigate = useNavigate();
const { imageLikeList, resetState } = useStore();
const [discardModalOpen, setDiscardModalOpen] = useState(false);

Expand All @@ -40,7 +41,7 @@ function Start() {
if (isDataAvailable) {
setDiscardModalOpen(true);
} else {
window.location.href = "/selection";
navigate("/selection");
}
};

Expand Down

0 comments on commit 069b4a1

Please sign in to comment.