From 51a2782d3c0dec0da8a708edf6b9c07dc883aba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Fri, 18 Apr 2025 14:24:46 +0900 Subject: [PATCH] =?UTF-8?q?plan=20=EC=B6=94=EA=B0=80=20=EB=A1=9C=EC=A7=81?= =?UTF-8?q?=20=EC=82=BC=ED=95=AD=EC=97=B0=EC=82=B0=EC=9E=90=20->=20if=20?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/usePlan.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index 0bc2a5d5..f812f00e 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -449,26 +449,26 @@ export function usePlan(params = {}) { if (currentCanvasPlan?.id) { await saveCanvas(false) } - JSON.parse(currentCanvasData()).objects.length > 0 - ? swalFire({ - text: `Plan ${currentCanvasPlan.planNo} ` + getMessage('plan.message.confirm.copy'), - type: 'confirm', - confirmFn: async () => { - setIsGlobalLoading(true) - await postObjectPlan(userId, objectNo, true, false) - setIsGlobalLoading(false) - }, - denyFn: async () => { - setIsGlobalLoading(true) - await postObjectPlan(userId, objectNo, false, false) - setIsGlobalLoading(false) - }, - }) - : async () => { + if (JSON.parse(currentCanvasData()).objects.length > 0) { + swalFire({ + text: `Plan ${currentCanvasPlan.planNo} ` + getMessage('plan.message.confirm.copy'), + type: 'confirm', + confirmFn: async () => { + setIsGlobalLoading(true) + await postObjectPlan(userId, objectNo, true, false) + setIsGlobalLoading(false) + }, + denyFn: async () => { setIsGlobalLoading(true) await postObjectPlan(userId, objectNo, false, false) setIsGlobalLoading(false) - } + }, + }) + } else { + setIsGlobalLoading(true) + await postObjectPlan(userId, objectNo, false, false) + setIsGlobalLoading(false) + } } /**