fix(ui/topbar): admin panel is not refreshed in loading
This commit is contained in:
parent
9cd6d6f84b
commit
bd6f961d03
1 changed files with 18 additions and 3 deletions
|
@ -18,9 +18,24 @@ export class TopBar extends React.Component<Props, State, {}> {
|
||||||
this.props.update(updater().updatePanes);
|
this.props.update(updater().updatePanes);
|
||||||
};
|
};
|
||||||
|
|
||||||
showAdmin = () => {
|
showAdmin = async () => {
|
||||||
updater().displayPane("admin");
|
return updater()
|
||||||
this.props.update(updater().updatePanes);
|
.self()
|
||||||
|
.then(() => {
|
||||||
|
// TODO: use props instead
|
||||||
|
// TODO: remove hardcode role
|
||||||
|
if (
|
||||||
|
updater().props.login.authed &&
|
||||||
|
updater().props.panes.userRole === "admin"
|
||||||
|
) {
|
||||||
|
return Promise.all([updater().listRoles(), updater().listUsers()]);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
updater().displayPane("admin");
|
||||||
|
this.props.update(updater().updateAdmin);
|
||||||
|
this.props.update(updater().updatePanes);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue