Skip to content

Commit

Permalink
fix: 수정하기 페이지에 뒤로가기로 접근했을 경우 대비
Browse files Browse the repository at this point in the history
  • Loading branch information
se0jinYoon committed Oct 22, 2024
1 parent 8a1a6b4 commit 27eccd4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/postPage/PostPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import styled from '@emotion/styled';
import { createBrowserHistory } from 'history';
import React, { useEffect, useReducer, useState } from 'react';
import { useLocation, useNavigate, useParams } from 'react-router-dom';
import { replace, useLocation, useNavigate, useParams } from 'react-router-dom';

import DropDown from './components/DropDown';
import ImageUpload from './components/ImageUpload';
Expand Down Expand Up @@ -33,6 +33,7 @@ import Spacing from '../../components/commons/Spacing';
import useModal from '../../hooks/useModal';
import useBlockPageExit from '../../hooks/useBlockPageExit';
import { MODAL } from './constants/modalContent';
import Error from '../error/Error';

// editor content API 관련
interface editorStateType {
Expand Down Expand Up @@ -360,7 +361,7 @@ const PostPage = () => {
// 수정하기 모달 확인
const onClickEditSaveModalBtn = () => {
localStorage.removeItem('editPostState');
navigate(`/detail/${groupId}/${editPostId}`);
navigate(`/detail/${groupId}/${editPostId}`, { replace: true });
};
// 최초 글 임시 저장
const { mutate: postTempSaveContent } = usePostTempSaveContent({
Expand Down

0 comments on commit 27eccd4

Please sign in to comment.