perf: response tag;feat: history quote

This commit is contained in:
archer
2023-08-15 09:55:00 +08:00
parent b8a65e1742
commit cc57a7e27e
9 changed files with 39 additions and 32 deletions

View File

@@ -26,6 +26,12 @@ const PayRecordTable = () => {
const [payOrders, setPayOrders] = useState<PaySchema[]>([]);
const { toast } = useToast();
const { isInitialLoading, refetch } = useQuery(['initPayOrder'], getPayOrders, {
onSuccess(res) {
setPayOrders(res);
}
});
const handleRefreshPayOrder = useCallback(
async (payId: string) => {
setIsLoading(true);
@@ -36,8 +42,6 @@ const PayRecordTable = () => {
title: data,
status: 'success'
});
const res = await getPayOrders();
setPayOrders(res);
} catch (error: any) {
toast({
title: error?.message,
@@ -45,18 +49,15 @@ const PayRecordTable = () => {
});
console.log(error);
}
try {
refetch();
} catch (error) {}
setIsLoading(false);
},
[setIsLoading, toast]
[refetch, setIsLoading, toast]
);
const { isInitialLoading } = useQuery(['initPayOrder'], getPayOrders, {
onSuccess(res) {
setPayOrders(res);
}
});
return (
<Box position={'relative'} h={'100%'}>
{!isInitialLoading && payOrders.length === 0 ? (