From 15a94867faf2e4a8363c7359bd3742e6f34cb9a5 Mon Sep 17 00:00:00 2001 From: Akira Date: Sun, 15 Feb 2026 14:57:26 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=AE=8C=E4=BA=86=20?= =?UTF-8?q?=E4=BD=9C=E4=BB=98=E3=81=91=E8=A8=88=E7=94=BB=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E3=81=AE=E3=82=B9=E3=82=AF=E3=83=AD=E3=83=BC=E3=83=AB=E3=83=AA?= =?UTF-8?q?=E3=82=BB=E3=83=83=E3=83=88=E9=98=B2=E6=AD=A2:=201.=20fetchData?= =?UTF-8?q?=20=E3=81=AB=20background=20=E3=83=91=E3=83=A9=E3=83=A1?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E8=BF=BD=E5=8A=A0:=20=20=20=20-=20background?= =?UTF-8?q?=20=3D=20false=20=E3=81=AE=E5=A0=B4=E5=90=88=E3=81=AE=E3=81=BF?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=83=87=E3=82=A3=E3=83=B3=E3=82=B0=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=20=20=20=20-=20background=20=3D=20true=20=E3=81=AE?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=81=AF=E3=83=90=E3=83=83=E3=82=AF=E3=82=B0?= =?UTF-8?q?=E3=83=A9=E3=82=A6=E3=83=B3=E3=83=89=E6=9B=B4=E6=96=B0=EF=BC=88?= =?UTF-8?q?=E3=82=B9=E3=83=94=E3=83=8A=E3=83=BC=E3=81=AA=E3=81=97=EF=BC=89?= =?UTF-8?q?=202.=20=E4=BF=9D=E5=AD=98=E3=83=8F=E3=83=B3=E3=83=89=E3=83=A9?= =?UTF-8?q?=E3=81=A7=20fetchData(true)=20=E3=82=92=E5=91=BC=E3=81=B3?= =?UTF-8?q?=E5=87=BA=E3=81=97:=20=20=20=20-=20handleCropChange,=20handleVa?= =?UTF-8?q?rietyChange,=20handleNotesChange=20=E3=81=AE3=E7=AE=87=E6=89=80?= =?UTF-8?q?=20=E3=81=93=E3=82=8C=E3=81=AB=E3=82=88=E3=82=8A=E3=80=81?= =?UTF-8?q?=E4=BD=9C=E7=89=A9=E3=83=BB=E5=93=81=E7=A7=8D=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=99=82=E3=81=AB=E7=94=BB=E9=9D=A2=E3=81=8C=E3=83=81=E3=83=A9?= =?UTF-8?q?=E3=81=A4=E3=81=84=E3=81=9F=E3=82=8A=E3=82=B9=E3=82=AF=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=81=8C=E3=83=AA=E3=82=BB=E3=83=83=E3=83=88?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=9F=E3=82=8A=E3=81=97=E3=81=AA=E3=81=8F?= =?UTF-8?q?=E3=81=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/app/allocation/page.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/allocation/page.tsx b/frontend/src/app/allocation/page.tsx index 59fb23b..e944f97 100644 --- a/frontend/src/app/allocation/page.tsx +++ b/frontend/src/app/allocation/page.tsx @@ -17,8 +17,8 @@ export default function AllocationPage() { fetchData(); }, [year]); - const fetchData = async () => { - setLoading(true); + const fetchData = async (background = false) => { + if (!background) setLoading(true); try { const [fieldsRes, cropsRes, plansRes] = await Promise.all([ api.get('/fields/'), @@ -31,7 +31,7 @@ export default function AllocationPage() { } catch (error) { console.error('Failed to fetch data:', error); } finally { - setLoading(false); + if (!background) setLoading(false); } }; @@ -64,7 +64,7 @@ export default function AllocationPage() { notes: '', }); } - await fetchData(); + await fetchData(true); } catch (error) { console.error('Failed to save crop:', error); } finally { @@ -87,7 +87,7 @@ export default function AllocationPage() { variety, notes: existingPlan.notes, }); - await fetchData(); + await fetchData(true); } catch (error) { console.error('Failed to save variety:', error); } finally { @@ -108,7 +108,7 @@ export default function AllocationPage() { await api.patch(`/plans/${existingPlan.id}/`, { notes, }); - await fetchData(); + await fetchData(true); } catch (error) { console.error('Failed to save notes:', error); } finally {