Fix navigation warnings.

This commit is contained in:
Dessalines 2023-06-14 08:07:28 -04:00
parent 2529322afd
commit 32e82a93f4
2 changed files with 5 additions and 3 deletions

View file

@ -136,7 +136,11 @@ export class MarkdownTextArea extends Component<
return ( return (
<form id={this.formId} onSubmit={linkEvent(this, this.handleSubmit)}> <form id={this.formId} onSubmit={linkEvent(this, this.handleSubmit)}>
<NavigationPrompt <NavigationPrompt
when={!!this.state.content && !this.state.submitted} when={
!this.props.hideNavigationWarnings &&
!!this.state.content &&
!this.state.submitted
}
/> />
<div className="form-group row"> <div className="form-group row">
<div className={`col-sm-12`}> <div className={`col-sm-12`}>

View file

@ -225,8 +225,6 @@ export class CreatePost extends Component<
const postId = res.data.post_view.post.id; const postId = res.data.post_view.post.id;
this.props.history.replace(`/post/${postId}`); this.props.history.replace(`/post/${postId}`);
} }
return res;
} }
static fetchInitialData({ static fetchInitialData({