Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] 사파리 - navigate(0) 작동 되지 않는 이슈 해결 #307

Merged
merged 1 commit into from
Jul 30, 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
4 changes: 2 additions & 2 deletions src/common/components/Layout/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ const Header = () => {
const menuItems = isMakers ? MENU_ITEMS_MAKERS : MENU_ITEMS;

const handleClickLogo = () => {
pathname === '/' ? navigate(0) : navigate('/');
pathname === '/' ? window.location.reload() : navigate('/');
};

const handleLogout = () => {
track('click-gnb-logout');
reset();
localStorage.removeItem('soptApplyAccessToken');
localStorage.removeItem('soptApplyAccessTokenExpiredTime');
pathname === '/' ? navigate(0) : navigate('/');
pathname === '/' ? window.location.reload() : navigate('/');
};
return (
<>
Expand Down
4 changes: 1 addition & 3 deletions src/views/CompletePage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { track } from '@amplitude/analytics-browser';
import { useContext } from 'react';
import { useNavigate } from 'react-router-dom';

import Button from '@components/Button';
import Callout from '@components/Callout';
Expand All @@ -10,15 +9,14 @@ import IconCheckmark from './icons/IconCheckmark';
import { container, icon, mainText, subText } from './style.css';

const CompletePage = () => {
const navigate = useNavigate();
const {
recruitingInfo: { name, season, group, soptName },
} = useContext(RecruitingInfoContext);
const isMakers = soptName?.toLowerCase().includes('makers');

const handleClickMyPage = () => {
track('click-complete-my');
navigate(0);
window.location.reload();
};

return (
Expand Down
5 changes: 1 addition & 4 deletions src/views/SignInPage/hooks/useMutateSignIn.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { setUserId } from '@amplitude/analytics-browser';
import { useMutation } from '@tanstack/react-query';
import { useNavigate } from 'react-router-dom';

import { VALIDATION_CHECK } from '@constants/validationCheck';

Expand All @@ -16,8 +15,6 @@ interface MutateSignInProps {
}

const useMutateSignIn = ({ finalPassConfirmEnd, onSetError }: MutateSignInProps) => {
const navigate = useNavigate();

const { mutate: signInMutate, isPending: signInIsPending } = useMutation<
AxiosResponse<SignInResponse, SignInRequest>,
AxiosError<ErrorResponse, SignInRequest>,
Expand All @@ -28,7 +25,7 @@ const useMutateSignIn = ({ finalPassConfirmEnd, onSetError }: MutateSignInProps)
setUserId(email);
localStorage.setItem('soptApplyAccessToken', token);
localStorage.setItem('soptApplyAccessTokenExpiredTime', finalPassConfirmEnd || '');
navigate(0);
window.location.reload();
},
onError(error) {
if (error.response?.status === 403) {
Expand Down