mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 12:20:31 +00:00
Merge pull request #37 from bigcapitalhq/BIG-add-keepPreviousData
BIG: add keepPreviousData option on use query.
This commit is contained in:
@@ -18,6 +18,7 @@ function APAgingSummaryHeaderDimensionsProvider({ query, ...props }) {
|
||||
// Fetches the branches list.
|
||||
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
||||
enabled: isBranchFeatureCan,
|
||||
keepPreviousData: true,
|
||||
});
|
||||
|
||||
// Provider
|
||||
|
||||
@@ -18,6 +18,7 @@ function ARAgingSummaryHeaderDimensionsProvider({ query, ...props }) {
|
||||
// Fetches the branches list.
|
||||
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
||||
enabled: isBranchFeatureCan,
|
||||
keepPreviousData: true,
|
||||
});
|
||||
|
||||
// Provider
|
||||
|
||||
@@ -19,6 +19,7 @@ function BalanceSheetHeaderDimensionsProvider({ query, ...props }) {
|
||||
// Fetches the branches list.
|
||||
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
||||
enabled: isBranchFeatureCan,
|
||||
keepPreviousData: true,
|
||||
});
|
||||
|
||||
// Provider
|
||||
|
||||
@@ -10,16 +10,16 @@ const CashFlowStatementDimensionsPanelContext = React.createContext();
|
||||
* cash flow statement dimensions panel provider.
|
||||
* @returns
|
||||
*/
|
||||
function CashFlowStatementDimensionsPanelProvider({ query,...props }) {
|
||||
function CashFlowStatementDimensionsPanelProvider({ query, ...props }) {
|
||||
// Features guard.
|
||||
const { featureCan } = useFeatureCan();
|
||||
const isBranchFeatureCan = featureCan(Features.Branches);
|
||||
|
||||
// Fetches the branches list.
|
||||
const { isLoading: isBranchesLoading, data: branches } = useBranches(
|
||||
query,
|
||||
{ enabled: isBranchFeatureCan },
|
||||
);
|
||||
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
||||
enabled: isBranchFeatureCan,
|
||||
keepPreviousData: true,
|
||||
});
|
||||
|
||||
// Provider
|
||||
const provider = {
|
||||
|
||||
@@ -19,6 +19,7 @@ function GeneralLedgerHeaderDimensionsPanelProvider({ query, ...props }) {
|
||||
// Fetches the branches list.
|
||||
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
||||
enabled: isBranchFeatureCan,
|
||||
keepPreviousData: true,
|
||||
});
|
||||
|
||||
// Provider
|
||||
|
||||
@@ -24,12 +24,13 @@ function InventoryValuationHeaderDimensionsProvider({ ...props }) {
|
||||
// Fetches the warehouses list.
|
||||
const { data: warehouses, isLoading: isWarehouesLoading } = useWarehouses(
|
||||
null,
|
||||
{ enabled: isWarehouseFeatureCan },
|
||||
{ enabled: isWarehouseFeatureCan, keepPreviousData: true },
|
||||
);
|
||||
|
||||
// Fetches the branches list.
|
||||
const { data: branches, isLoading: isBranchLoading } = useBranches(null, {
|
||||
enabled: isBranchFeatureCan,
|
||||
keepPreviousData: true,
|
||||
});
|
||||
|
||||
// Provider
|
||||
|
||||
@@ -15,9 +15,12 @@ function ProfitLossSheetProvider({ query, ...props }) {
|
||||
isFetching,
|
||||
isLoading,
|
||||
refetch,
|
||||
} = useProfitLossSheet({
|
||||
...transformFilterFormToQuery(query),
|
||||
});
|
||||
} = useProfitLossSheet(
|
||||
{
|
||||
...transformFilterFormToQuery(query),
|
||||
},
|
||||
{ keepPreviousData: true },
|
||||
);
|
||||
|
||||
const provider = {
|
||||
profitLossSheet,
|
||||
|
||||
@@ -19,6 +19,7 @@ function ProfitLossSheetHeaderDimensionsProvider({ query, ...props }) {
|
||||
// Fetches the branches list.
|
||||
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
||||
enabled: isBranchFeatureCan,
|
||||
keepPreviousData: true,
|
||||
});
|
||||
|
||||
// Provider
|
||||
|
||||
@@ -18,6 +18,7 @@ function TrialBLHeaderDimensionsPanelProvider({ query, ...props }) {
|
||||
// Fetches the branches list.
|
||||
const { isLoading: isBranchesLoading, data: branches } = useBranches(query, {
|
||||
enabled: isBranchFeatureCan,
|
||||
keepPreviousData: true,
|
||||
});
|
||||
|
||||
// Provider
|
||||
|
||||
Reference in New Issue
Block a user