feat: fix showing wrong error messages (#1385)

This commit is contained in:
Yaodong Yu
2022-12-09 15:11:13 +08:00
committed by GitHub
parent e705eecffe
commit b41d8652f0
11 changed files with 48 additions and 19 deletions

View File

@ -92,6 +92,7 @@ class PolicyTable extends React.Component {
.then((res) => {
if (res.status === "ok") {
this.setState({policyLists: res.data});
Setting.showMessage("success", i18next.t("adapter:Sync policies successfully"));
} else {
Setting.showMessage("error", `${i18next.t("adapter:Failed to sync policies")}: ${res.msg}`);
}
@ -293,7 +294,7 @@ class PolicyTable extends React.Component {
render() {
return (<>
<Button type="primary" onClick={() => {this.synPolicies();}}>
<Button type="primary" disabled={this.state.editingIndex !== ""} onClick={() => {this.synPolicies();}}>
{i18next.t("adapter:Sync")}
</Button>
{