| @@ -15,7 +15,7 @@ import useAPICall from "hooks/useAPICall"; | |||||
| import useDashboard from "hooks/useDashBoard"; | import useDashboard from "hooks/useDashBoard"; | ||||
| import useTable from "hooks/useTable"; | import useTable from "hooks/useTable"; | ||||
| import { PageID, TabID } from "pages"; | import { PageID, TabID } from "pages"; | ||||
| import { useEffect } from "react"; | |||||
| import { useEffect, useState } from "react"; | |||||
| import { numberFormat } from "utils/string"; | import { numberFormat } from "utils/string"; | ||||
| const TABLE_HEAD: HeadLabelProps[] = [ | const TABLE_HEAD: HeadLabelProps[] = [ | ||||
| @@ -31,6 +31,8 @@ export default function ReceiptDownload() { | |||||
| TabID.NONE | TabID.NONE | ||||
| ); | ); | ||||
| const [fetched, setFetched] = useState(false); | |||||
| const { | const { | ||||
| order, | order, | ||||
| page, | page, | ||||
| @@ -57,7 +59,9 @@ export default function ReceiptDownload() { | |||||
| }); | }); | ||||
| useEffect(() => { | useEffect(() => { | ||||
| callGetReceipts({}); | |||||
| callGetReceipts({}).then(() => { | |||||
| setFetched(true); | |||||
| }); | |||||
| }, []); | }, []); | ||||
| useEffect(() => { | useEffect(() => { | ||||
| @@ -65,6 +69,14 @@ export default function ReceiptDownload() { | |||||
| setTabs(null); | setTabs(null); | ||||
| }, [setHeaderTitle, setTabs]); | }, [setHeaderTitle, setTabs]); | ||||
| if (!fetched) { | |||||
| return null; | |||||
| } | |||||
| if (dataLength === 0) { | |||||
| return <Box>データがありません</Box>; | |||||
| } | |||||
| return ( | return ( | ||||
| <Box> | <Box> | ||||
| <TableContainer | <TableContainer | ||||