Fixes autocomplete to not to crash if rootId is undefined (#804)

This commit is contained in:
enahum 2017-07-31 18:39:10 -04:00 committed by GitHub
parent d5513a4585
commit 2216843854
3 changed files with 3 additions and 3 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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;