From 4622b91d72360b6f2e85da0b6f7b655dd49de41f Mon Sep 17 00:00:00 2001 From: "sosuke.iwabuchi" Date: Tue, 5 Dec 2023 17:35:01 +0900 Subject: [PATCH] =?UTF-8?q?=E9=A0=98=E5=8F=8E=E6=9B=B8=E4=B8=80=E8=A6=A7?= =?UTF-8?q?=E3=80=80=E3=83=87=E3=83=BC=E3=82=BF=E3=81=AA=E3=81=84=E5=A0=B4?= =?UTF-8?q?=E5=90=88=E3=81=AB=E3=83=86=E3=83=BC=E3=83=96=E3=83=AB=E3=82=92?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/dashboard/receipt/download.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/pages/dashboard/receipt/download.tsx b/src/pages/dashboard/receipt/download.tsx index 9000d8a..297033c 100644 --- a/src/pages/dashboard/receipt/download.tsx +++ b/src/pages/dashboard/receipt/download.tsx @@ -15,7 +15,7 @@ import useAPICall from "hooks/useAPICall"; import useDashboard from "hooks/useDashBoard"; import useTable from "hooks/useTable"; import { PageID, TabID } from "pages"; -import { useEffect } from "react"; +import { useEffect, useState } from "react"; import { numberFormat } from "utils/string"; const TABLE_HEAD: HeadLabelProps[] = [ @@ -31,6 +31,8 @@ export default function ReceiptDownload() { TabID.NONE ); + const [fetched, setFetched] = useState(false); + const { order, page, @@ -57,7 +59,9 @@ export default function ReceiptDownload() { }); useEffect(() => { - callGetReceipts({}); + callGetReceipts({}).then(() => { + setFetched(true); + }); }, []); useEffect(() => { @@ -65,6 +69,14 @@ export default function ReceiptDownload() { setTabs(null); }, [setHeaderTitle, setTabs]); + if (!fetched) { + return null; + } + + if (dataLength === 0) { + return データがありません; + } + return (