Skip to content

Commit

Permalink
Merge pull request #130 from EFUB4-Jukebox/dev
Browse files Browse the repository at this point in the history
🚑️ Hotfix : 핀 생성하기 여러번 누르기 방지
  • Loading branch information
YoungseoChoi23 authored Sep 13, 2024
2 parents 4489d63 + c89ed9a commit b4c8855
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/pages/CreatePinPage/CreatePinPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const CreatePinPage = () => {
const [active, setActive] = useState(false);
const [infoMsg, setInfoMsg] = useState("");
const { setIsSnackbar } = useSnackbarStore();
const [disabled, setDisabled] = useState(false);
const calendarRef = useRef(null);

const navigate = useNavigate();
Expand Down Expand Up @@ -75,6 +76,10 @@ const CreatePinPage = () => {

const handlePostPin = async e => {
e.preventDefault();

if (disabled) return;

setDisabled(true);
const request = {
song: {
title: selectedPin.title,
Expand Down Expand Up @@ -115,6 +120,9 @@ const CreatePinPage = () => {
//navigate(`/details-song/${songId}`);
window.location.href = `/details-song/${songId}?${placeParams}`;
}
setTimeout(() => {
setDisabled(false);
}, 5000);
};

useEffect(() => {
Expand Down

0 comments on commit b4c8855

Please sign in to comment.