don't unmount create form on error

This commit is contained in:
Sebastian Sdorra
2018-08-03 08:37:09 +02:00
parent 9f4f57cdc1
commit 5ddc595bf1
2 changed files with 4 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ type Props = {
subtitle?: string,
loading?: boolean,
error?: Error,
showContentOnError?: boolean,
children: React.Node
};
@@ -35,8 +36,8 @@ class Page extends React.Component<Props> {
}
renderContent() {
const { loading, children, error } = this.props;
if (error) {
const { loading, children, showContentOnError, error } = this.props;
if (error && !showContentOnError) {
return null;
}
if (loading) {

View File

@@ -48,6 +48,7 @@ class AddUser extends React.Component<Props> {
title={t("add-user.title")}
subtitle={t("add-user.subtitle")}
error={error}
showContentOnError={true}
>
<UserForm
submitForm={user => this.createUser(user)}