diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-08-17 09:35:36 -0700 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-08-17 09:35:36 -0700 |
commit | fd1301779fecc2910a9fdcf93af52ff33a4349ba (patch) | |
tree | ccd8b35d347b77c8c6a99db9422b3dbc0ff3bd2d /webapp/stores | |
parent | d41f1695e99a81808f5dc1fbe7820062947b5291 (diff) | |
parent | 0033e3e37b12cb5d951d21492500d66a6abc472b (diff) | |
download | chat-fd1301779fecc2910a9fdcf93af52ff33a4349ba.tar.gz chat-fd1301779fecc2910a9fdcf93af52ff33a4349ba.tar.bz2 chat-fd1301779fecc2910a9fdcf93af52ff33a4349ba.zip |
Merge branch 'release-4.1'
Diffstat (limited to 'webapp/stores')
-rw-r--r-- | webapp/stores/localization_store.jsx | 2 | ||||
-rw-r--r-- | webapp/stores/search_store.jsx | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/webapp/stores/localization_store.jsx b/webapp/stores/localization_store.jsx index 0a25c860d..2eb482699 100644 --- a/webapp/stores/localization_store.jsx +++ b/webapp/stores/localization_store.jsx @@ -12,7 +12,7 @@ class LocalizationStoreClass extends EventEmitter { constructor() { super(); - this.currentLocale = ''; + this.currentLocale = 'en'; this.currentTranslations = null; } diff --git a/webapp/stores/search_store.jsx b/webapp/stores/search_store.jsx index dd9b6dbdf..7db0ed92a 100644 --- a/webapp/stores/search_store.jsx +++ b/webapp/stores/search_store.jsx @@ -174,11 +174,14 @@ SearchStore.dispatchToken = AppDispatcher.register((payload) => { var action = payload.action; switch (action.type) { - case ActionTypes.RECEIVED_SEARCH: + case ActionTypes.RECEIVED_SEARCH: { + const results = SearchStore.getSearchResults() || {}; + const posts = Object.values(results.posts || {}); + const channelId = posts.length > 0 ? posts[0].channel_id : ''; if (SearchStore.getIsPinnedPosts() === action.is_pinned_posts && action.is_pinned_posts === true && - SearchStore.getSearchResults().posts && - ChannelStore.getCurrentId() !== Object.values(SearchStore.getSearchResults().posts)[0].channel_id) { + channelId !== '' && + ChannelStore.getCurrentId() !== channelId) { // ignore pin posts update after switch to a new channel return; } @@ -186,6 +189,7 @@ SearchStore.dispatchToken = AppDispatcher.register((payload) => { SearchStore.storeSearchResults(action.results, action.is_mention_search, action.is_flagged_posts, action.is_pinned_posts); SearchStore.emitSearchChange(); break; + } case ActionTypes.RECEIVED_SEARCH_TERM: if (action.do_search) { // while a search is in progress, hide results from previous search |