feat: certEditPage will be redirected to 404 when name is changed (#3154)

This commit is contained in:
DacongDA 2024-08-30 23:04:50 +08:00 committed by GitHub
parent 45dd4cc344
commit ec98785172
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -288,14 +288,14 @@ class CertEditPage extends React.Component {
Setting.showMessage("success", i18next.t("general:Successfully saved"));
this.setState({
certName: this.state.cert.name,
}, () => {
if (exitAfterSave) {
this.props.history.push("/certs");
} else {
this.props.history.push(`/certs/${this.state.cert.owner}/${this.state.cert.name}`);
this.getCert();
}
});
if (exitAfterSave) {
this.props.history.push("/certs");
} else {
this.props.history.push(`/certs/${this.state.cert.owner}/${this.state.cert.name}`);
this.getCert();
}
} else {
Setting.showMessage("error", `${i18next.t("general:Failed to save")}: ${res.msg}`);
this.updateCertField("name", this.state.certName);