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

TargetStatus初期化 #51

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading