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

옵티미스틱 업데이트 수정 #132

Merged
merged 4 commits into from
Jul 19, 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: 3 additions & 1 deletion src/components/detail/LikePokemon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ const LikePokemon = ({ pokemonId, isLoading }: LikePokemonProps) => {
if (!user?.uid) {
return alert('로그인이 필요합니다.');
}

setIsLiked((prev) => !prev);
setAnimate(true);

try {
const docSnap = await getDocument(`/likes/${user.uid}`);
let likes = [];
Expand All @@ -61,7 +64,6 @@ const LikePokemon = ({ pokemonId, isLoading }: LikePokemonProps) => {
});
} catch (error) {
console.log(error);
} finally {
setIsLiked((prev) => !prev);
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/dex/PokemonDex.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
}

.pokemon_list_element {
width: 100%;
height: 315px;
/* width: 100%;
height: 315px; */
display: flex;
position: relative;
align-items: center;
Expand Down
Loading