Skip to content

Commit

Permalink
removed unneccessary codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Saiful Alam Rakib committed Oct 9, 2023
1 parent 6dc3cea commit 6891dbb
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions src/pages/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,24 @@ import Layout from "../components/Layout";
import { getLastOpenId } from "../utils";

export default function Home() {
const lastId = getLastOpenId();
const navigate = useNavigate();
const lastId = getLastOpenId();
const navigate = useNavigate();

useEffect(() => {
if (
lastId &&
// eslint-disable-next-line no-restricted-globals
confirm("You have a last edited note,\nDo you want to open it?")
) {
navigate(`/n/${lastId}`);
} else {
navigate(`/new`);
}
}, [navigate, lastId]);
useEffect(() => {
if (
lastId &&
// eslint-disable-next-line no-restricted-globals
confirm("You have a last edited note,\nDo you want to open it?")
) {
navigate(`/n/${lastId}`);
} else {
navigate(`/new`);
}
}, [navigate, lastId]);

console.log('Home', { lastId });

return (
<Layout>
<div className="flex-center loading">Loading...</div>
</Layout>
);
return (
<Layout>
<div className="flex-center loading">Loading...</div>
</Layout>
);
}

0 comments on commit 6891dbb

Please sign in to comment.