Fix organization page bug

This commit is contained in:
Yang Luo
2023-03-31 18:35:57 +08:00
parent 9c8ea027ef
commit 8d1ae4ea08
2 changed files with 18 additions and 5 deletions

View File

@ -614,7 +614,7 @@ class UserEditPage extends React.Component {
);
}
submitUserEdit(willExist) {
submitUserEdit(needExit) {
const user = Setting.deepCopy(this.state.user);
UserBackend.updateUser(this.state.organizationName, this.state.userName, user)
.then((res) => {
@ -626,13 +626,18 @@ class UserEditPage extends React.Component {
});
if (this.props.history !== undefined) {
if (willExist) {
this.props.history.push("/users");
if (needExit) {
const userListUrl = sessionStorage.getItem("userListUrl");
if (userListUrl !== null) {
this.props.history.push(userListUrl);
} else {
this.props.history.push("/users");
}
} else {
this.props.history.push(`/users/${this.state.user.owner}/${this.state.user.name}`);
}
} else {
if (willExist) {
if (needExit) {
if (this.state.returnUrl) {
window.location.href = this.state.returnUrl;
}