From 8a15c0771ffdafa8e9a12c401c391d069292aa34 Mon Sep 17 00:00:00 2001 From: GuY8528 <125722953+GuY8528@users.noreply.github.com> Date: Thu, 6 Mar 2025 17:33:08 +0900 Subject: [PATCH] fix --- web/app/home/page.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/web/app/home/page.tsx b/web/app/home/page.tsx index da45ff4b..15945580 100644 --- a/web/app/home/page.tsx +++ b/web/app/home/page.tsx @@ -99,12 +99,13 @@ export default function Home() { // キューの更新などの処理 recommended.pop(); + rerender({}); + if (action === "accept") { - await request.send(current.id); - } else if (action === "reject") { + sendAcceptRequest(current.id); + } else { recommended.push(current); } - rerender({}); // アニメーション後に位置をリセット(backCard は再び初期レンダリング位置に戻す) controls.set({ x: 0 }); @@ -114,6 +115,14 @@ export default function Home() { [recommended, controls, backCardControls, targetPos], ); + async function sendAcceptRequest(userId: number) { + try { + await request.send(userId); + } catch (error) { + console.error("Failed to send accept request:", error); + } + } + if (loading) { return ; }