Skip to content

Commit

Permalink
♻️ Refactor: 웹스톰 PromiseFromCall 오류 대응
Browse files Browse the repository at this point in the history
  • Loading branch information
romantech committed Feb 11, 2022
1 parent 884eb6c commit 8302cc9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
7 changes: 3 additions & 4 deletions src/Components/BeerListFunction.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable react/prop-types */
// noinspection JSIgnoredPromiseFromCall

import React from 'react';
import styled, { css } from 'styled-components/macro';
Expand All @@ -14,12 +13,12 @@ const BeerListFunction = function ({ selectedRange, setSelectedRange }) {
const { isModified } = useSelector(({ tableColumns }) => tableColumns);
const dispatch = useDispatch();

const resetColumn = () => {
const resetColumn = async () => {
if (isModified) {
dispatch(resetColumns());
message.success('컬럼 순서를 초기화했습니다');
await message.success('컬럼 순서를 초기화했습니다');
} else {
message.warn('컬럼 순서가 이미 초기화 상태입니다');
await message.warn('컬럼 순서가 이미 초기화 상태입니다');
}
};

Expand Down
5 changes: 2 additions & 3 deletions src/Components/FavoriteEntry.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable react/prop-types */
// noinspection JSIgnoredPromiseFromCall

import React from 'react';
import styled from 'styled-components/macro';
Expand All @@ -14,9 +13,9 @@ const FavoriteEntry = function ({ data }) {
const dispatch = useDispatch();
const Image = useImage(data.image_url);

const removeHandler = () => {
const removeHandler = async () => {
dispatch(removeFromFavorites(data.id));
message.success('삭제 되었습니다');
await message.success('삭제 되었습니다');
};

const detailViewHandler = () => {
Expand Down
10 changes: 4 additions & 6 deletions src/Pages/FavoritePage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// noinspection JSIgnoredPromiseFromCall

import React from 'react';
import styled, { css } from 'styled-components/macro';
import { useDispatch, useSelector } from 'react-redux';
Expand All @@ -15,18 +13,18 @@ const FavoritePage = function () {
const { rawData: beers } = useSelector(({ beerList }) => beerList);
const { favorites } = useSelector(({ favoriteList }) => favoriteList);

const clearFavoritesHandler = () => {
const clearFavoritesHandler = async () => {
if (favorites?.length === 0) {
message.warn('즐겨찾기가 이미 비어있습니다');
await message.warn('즐겨찾기가 이미 비어있습니다');
return;
}
Modal.confirm({
title: '주의',
content: `즐겨찾기에 있는 모든 맥주(${favorites.length})를 삭제하시겠습니까?`,
maskClosable: true,
onOk: () => {
onOk: async () => {
dispatch(clearFavorites());
message.success('모든 즐겨찾기가 삭제되었습니다');
await message.success('모든 즐겨찾기가 삭제되었습니다');
},
});
};
Expand Down

1 comment on commit 8302cc9

@vercel
Copy link

@vercel vercel bot commented on 8302cc9 Feb 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.