Skip to content

Commit 290b8d8

Browse files
authored
Merge pull request #70 from Stack-Knowledge/hotfix/timeOut
Add delay
2 parents ca6bd8d + 78e468f commit 290b8d8

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

projects/admin/src/components/ShopItemCard/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ const ShopItemCard: React.FC<ShopItemCardProps> = ({
3131
};
3232

3333
if (isSuccess) {
34-
window.location.reload();
34+
setTimeout(() => {
35+
window.location.reload();
36+
}, 1000);
3537
toast.success('상품 개수가 1개 차감되었습니다.');
3638
}
3739

projects/client/src/components/RankingHeader/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,17 @@ const RankingHeader: React.FC<RankingHeaderProps> = ({
3838
};
3939

4040
if (isSuccess) {
41+
setTimeout(() => {
42+
location.reload();
43+
}, 1000);
4144
toast.success('이미지 등록에 성공했습니다.');
42-
location.reload();
4345
}
4446

4547
if (isError) {
48+
setTimeout(() => {
49+
location.reload();
50+
}, 1000);
4651
toast.error('잘못된 파일 유형입니다.');
47-
location.reload();
4852
}
4953

5054
return (

projects/client/src/components/ShopModal/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ const ShopModal: React.FC<ShopModalProps> = ({ selectedList }) => {
5151

5252
if (isError) {
5353
if (error && error.response?.status === 400) {
54+
setTimeout(() => {
55+
location.reload();
56+
}, 1000);
5457
toast.error('마일리지가 부족합니다.');
55-
location.reload();
5658
}
5759
}
5860

0 commit comments

Comments
 (0)