Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
fix: init target status
Browse files Browse the repository at this point in the history
  • Loading branch information
claustra01 committed Aug 19, 2024
1 parent 71f8a08 commit 06b8574
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/components/Gallery/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import { useNavigate } from "react-router-dom";
import { useRoomIdStore, useTargetStatusStore } from "../../store";
import { useRoomIdStore } from "../../store";
import styles from "./index.module.css";

function Gallery() {
const navigate = useNavigate();
const updateUUID = useRoomIdStore((state) => state.updateUUID);
const resetTargetStatus = useTargetStatusStore(
(state) => state.resetTargetStatus,
);

const handleClick = () => {
resetTargetStatus();
updateUUID();
navigate("/");
};
Expand Down
11 changes: 11 additions & 0 deletions src/pages/yatai/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
import { useEffect } from "react";
import Gallery from "../../components/Gallery";
import { TargetOverlay } from "../../components/Yatai/TargetOverlay";
import { YataiStage } from "../../components/Yatai/YataiStage";
import { useTargetStatusStore } from "../../store";
import styles from "./index.module.css";

function Yatai() {
const resetTargetStatus = useTargetStatusStore(
(state) => state.resetTargetStatus,
);

// init target status
useEffect(() => {
resetTargetStatus();
}, [resetTargetStatus]);

return (
<div className={styles.container}>
<YataiStage />
Expand Down

0 comments on commit 06b8574

Please sign in to comment.