Skip to content

Commit

Permalink
fix: add loading to create federation(#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jandiasnow authored and Carrotzpc committed Feb 17, 2023
1 parent 9455b27 commit cebc689
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/pages/Federation/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class Federation$$Page extends React.Component {
searchKey: "name",
searchValue: undefined,
size: 10,
createLoading: false,
};
}

Expand Down Expand Up @@ -97,6 +98,9 @@ class Federation$$Page extends React.Component {
: _this$$$formRef$curre.form;
form.submit(async (v) => {
delete v.displayName;
this.setState({
createLoading: true,
});
try {
await this.props.appHelper.utils.bff.createFederation({
federation: v,
Expand All @@ -106,8 +110,14 @@ class Federation$$Page extends React.Component {
message: this.i18n("i18n-d4bbvp00v5t"),
});
this.props.useGetFederations.mutate();
this.setState({
createLoading: false,
});
} catch (error) {
var _error$response;
this.setState({
createLoading: false,
});
this.utils.notification.warnings({
message: this.i18n("i18n-n58z07yheg"),
errors:
Expand Down Expand Up @@ -324,7 +334,7 @@ class Federation$$Page extends React.Component {
],
}}
centered={false}
confirmLoading={false}
confirmLoading={__$$eval(() => this.state.createLoading || false)}
destroyOnClose={true}
forceRender={false}
keyboard={true}
Expand Down

0 comments on commit cebc689

Please sign in to comment.