Fixes autocomplete to not to crash if rootId is undefined (#804)
This commit is contained in:
parent
d5513a4585
commit
2216843854
3 changed files with 3 additions and 3 deletions
|
|
@ -17,7 +17,7 @@ function mapStateToProps(state, ownProps) {
|
|||
let postDraft;
|
||||
if (ownProps.isSearch) {
|
||||
postDraft = state.views.search;
|
||||
} else if (ownProps.rootId.length) {
|
||||
} else if (ownProps.rootId) {
|
||||
const threadDraft = state.views.thread.drafts[ownProps.rootId];
|
||||
if (threadDraft) {
|
||||
postDraft = threadDraft.draft;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ function mapStateToProps(state, ownProps) {
|
|||
let postDraft;
|
||||
if (ownProps.isSearch) {
|
||||
postDraft = state.views.search;
|
||||
} else if (ownProps.rootId.length) {
|
||||
} else if (ownProps.rootId) {
|
||||
const threadDraft = state.views.thread.drafts[ownProps.rootId];
|
||||
if (threadDraft) {
|
||||
postDraft = threadDraft.draft;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ function mapStateToProps(state, ownProps) {
|
|||
const emojis = getEmojisByName(state);
|
||||
|
||||
let postDraft;
|
||||
if (ownProps.rootId.length) {
|
||||
if (ownProps.rootId) {
|
||||
const threadDraft = state.views.thread.drafts[ownProps.rootId];
|
||||
if (threadDraft) {
|
||||
postDraft = threadDraft.draft;
|
||||
|
|
|
|||
Loading…
Reference in a new issue