Web: Management: Spaces: fixed loader reset, added loader when changing domain
This commit is contained in:
parent
6b90bbf7d0
commit
00a8bad715
@ -69,11 +69,12 @@ const ConfigurationSection = ({ t }: TConfigurationSection): JSX.Element => {
|
||||
setReferenceLink(result);
|
||||
setSpaceCreatedDialogVisible(true);
|
||||
});
|
||||
await authStore.settingsStore
|
||||
.getAllPortals()
|
||||
.finally(() => setIsLoading(false));
|
||||
|
||||
await authStore.settingsStore.getAllPortals();
|
||||
} catch (err) {
|
||||
toastr.error(err);
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -9,6 +9,7 @@ import { observer } from "mobx-react";
|
||||
import { TextInput } from "@docspace/shared/components/text-input";
|
||||
import { useStore } from "SRC_DIR/store";
|
||||
import { parseDomain } from "SRC_DIR/utils";
|
||||
import { toastr } from "@docspace/shared/components/toast";
|
||||
|
||||
const StyledModal = styled(ModalDialogContainer)`
|
||||
.create-docspace-input-block {
|
||||
@ -24,7 +25,7 @@ const ChangeDomainDialogComponent = () => {
|
||||
const { spacesStore, authStore } = useStore();
|
||||
const [domainNameError, setDomainNameError] =
|
||||
React.useState<null | Array<object>>(null);
|
||||
|
||||
const [isLoading, setIsLoading] = React.useState<boolean>(false);
|
||||
const {
|
||||
setDomainName,
|
||||
getPortalDomain,
|
||||
@ -48,10 +49,19 @@ const ChangeDomainDialogComponent = () => {
|
||||
|
||||
if (!isValidDomain) return;
|
||||
|
||||
await setDomainName(domain);
|
||||
await authStore.settingsStore.getAllPortals();
|
||||
await getPortalDomain();
|
||||
onClose();
|
||||
try {
|
||||
setIsLoading(true);
|
||||
|
||||
await setDomainName(domain);
|
||||
await authStore.settingsStore.getAllPortals();
|
||||
await getPortalDomain();
|
||||
|
||||
onClose();
|
||||
} catch (err) {
|
||||
toastr.error(err);
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
@ -98,6 +108,7 @@ const ChangeDomainDialogComponent = () => {
|
||||
</ModalDialog.Body>
|
||||
<ModalDialog.Footer>
|
||||
<Button
|
||||
isLoading={isLoading}
|
||||
key="CreateButton"
|
||||
label={t("Common:ChangeButton")}
|
||||
onClick={onClickDomainChange}
|
||||
|
Loading…
Reference in New Issue
Block a user