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

Commit

Permalink
Merge pull request #51 from claustra01/fix/reset-target-status
Browse files Browse the repository at this point in the history
TargetStatus初期化
  • Loading branch information
K-Kizuku authored Aug 19, 2024
2 parents 71f8a08 + 06b8574 commit 2fc430e
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 2fc430e

Please sign in to comment.