mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
Merge pull request #172 from bigcapitalhq/abouhuolia/big-29-no-currency-in-amount-field-on-money-inout-dialogs
fix(webapp): should not show the form before loading account
This commit is contained in:
@@ -27,7 +27,7 @@ function MoneyInDialogProvider({
|
|||||||
const isBranchFeatureCan = featureCan(Features.Branches);
|
const isBranchFeatureCan = featureCan(Features.Branches);
|
||||||
|
|
||||||
// Fetches accounts list.
|
// Fetches accounts list.
|
||||||
const { isFetching: isAccountsLoading, data: accounts } = useAccounts();
|
const { isLoading: isAccountsLoading, data: accounts } = useAccounts();
|
||||||
|
|
||||||
// Fetches the specific account details.
|
// Fetches the specific account details.
|
||||||
const { data: account, isLoading: isAccountLoading } = useAccount(accountId, {
|
const { data: account, isLoading: isAccountLoading } = useAccount(accountId, {
|
||||||
@@ -54,7 +54,7 @@ function MoneyInDialogProvider({
|
|||||||
// Submit payload.
|
// Submit payload.
|
||||||
const [submitPayload, setSubmitPayload] = React.useState({});
|
const [submitPayload, setSubmitPayload] = React.useState({});
|
||||||
|
|
||||||
// provider.
|
// Provider data.
|
||||||
const provider = {
|
const provider = {
|
||||||
accounts,
|
accounts,
|
||||||
account,
|
account,
|
||||||
@@ -73,15 +73,15 @@ function MoneyInDialogProvider({
|
|||||||
setSubmitPayload,
|
setSubmitPayload,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isLoading =
|
||||||
|
isAccountsLoading ||
|
||||||
|
isCashFlowAccountsLoading ||
|
||||||
|
isBranchesLoading ||
|
||||||
|
isSettingsLoading ||
|
||||||
|
isAccountLoading;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DialogContent
|
<DialogContent isLoading={isLoading}>
|
||||||
isLoading={
|
|
||||||
isAccountsLoading ||
|
|
||||||
isCashFlowAccountsLoading ||
|
|
||||||
isBranchesLoading ||
|
|
||||||
isSettingsLoading
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<MoneyInDialogContent.Provider value={provider} {...props} />
|
<MoneyInDialogContent.Provider value={provider} {...props} />
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ function MoneyOutProvider({ accountId, accountType, dialogName, ...props }) {
|
|||||||
// Submit payload.
|
// Submit payload.
|
||||||
const [submitPayload, setSubmitPayload] = React.useState({});
|
const [submitPayload, setSubmitPayload] = React.useState({});
|
||||||
|
|
||||||
// provider.
|
// Provider data.
|
||||||
const provider = {
|
const provider = {
|
||||||
accounts,
|
accounts,
|
||||||
account,
|
account,
|
||||||
@@ -69,15 +69,15 @@ function MoneyOutProvider({ accountId, accountType, dialogName, ...props }) {
|
|||||||
setSubmitPayload,
|
setSubmitPayload,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isLoading =
|
||||||
|
isAccountsLoading ||
|
||||||
|
isCashFlowAccountsLoading ||
|
||||||
|
isBranchesLoading ||
|
||||||
|
isSettingsLoading ||
|
||||||
|
isAccountLoading;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DialogContent
|
<DialogContent isLoading={isLoading}>
|
||||||
isLoading={
|
|
||||||
isAccountsLoading ||
|
|
||||||
isCashFlowAccountsLoading ||
|
|
||||||
isBranchesLoading ||
|
|
||||||
isSettingsLoading
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<MoneyInDialogContent.Provider value={provider} {...props} />
|
<MoneyInDialogContent.Provider value={provider} {...props} />
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user