fix: 코드 재검토 반영 — 댓글 더 보기, 긴 비밀번호 500 방지, 토큰 갱신 실패 처리, 연타 막기

This commit is contained in:
minaChoi committed 2026-10-06 10:38:27 +09:00
1 parent ae6b06ac1f
commit be8f827556
7 files changed
+88 -30

No files matched your search

+2 -1
View File
@@ -229,7 +229,7 @@ function FullCard({ post }: PostProps) {
// 화면을 먼저 바꾸고, 실패하면 되돌린다 (서버는 실패도 200 + result.success=false 로 준다)
const setLike = (on: boolean) => {
if (!loggedIn) return open({ type: 'login' })
if (on === liked) return
if (on === liked || like.isPending || unlike.isPending) return
if (on) setPop((p) => p + 1)
patch({ liked: on, like_count: likeCount + (on ? 1 : -1) })
;(on ? like : unlike).mutate(
@@ -246,6 +246,7 @@ function FullCard({ post }: PostProps) {
const toggleSave = () => {
if (!loggedIn) return open({ type: 'login' })
if (save.isPending || unsave.isPending) return
const on = !saved
patch({ saved: on })
;(on ? save : unsave).mutate(