From cebc6897de6791740569e4d04299f73f10259c53 Mon Sep 17 00:00:00 2001 From: Jandiasnow <88074479@qq.com> Date: Fri, 17 Feb 2023 11:18:28 +0800 Subject: [PATCH] fix: add loading to create federation(#21) --- src/pages/Federation/index.jsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pages/Federation/index.jsx b/src/pages/Federation/index.jsx index 9d71361..8f348e5 100644 --- a/src/pages/Federation/index.jsx +++ b/src/pages/Federation/index.jsx @@ -64,6 +64,7 @@ class Federation$$Page extends React.Component { searchKey: "name", searchValue: undefined, size: 10, + createLoading: false, }; } @@ -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, @@ -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: @@ -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}