Updated chat_conversations, search actions redux

• Updated:
- chat_conversations unread_count to return 0
- search to return false if no user
This commit is contained in:
mgabdev 2021-01-10 02:16:30 -05:00
parent 60ce67309c
commit 44b3484cb2
2 changed files with 6 additions and 3 deletions

View File

@ -395,12 +395,12 @@ export const fetchChatConversationRequestedCount = () => (dispatch, getState) =>
export const fetchChatConversationUnreadCount = () => (dispatch, getState) => { export const fetchChatConversationUnreadCount = () => (dispatch, getState) => {
if (!me) return if (!me) return
api(getState).get('/api/v1/chat_conversations/approved_conversations/unread_count').then(response => { // api(getState).get('/api/v1/chat_conversations/approved_conversations/unread_count').then(response => {
dispatch({ dispatch({
type: CHAT_CONVERSATION_APPROVED_UNREAD_COUNT_FETCH_SUCCESS, type: CHAT_CONVERSATION_APPROVED_UNREAD_COUNT_FETCH_SUCCESS,
count: response.data, count: 0,
}) })
}) // })
} }
/** /**

View File

@ -6,6 +6,7 @@ import {
importFetchedStatuses, importFetchedStatuses,
} from './importer'; } from './importer';
import { importLinkCards } from './links' import { importLinkCards } from './links'
import { me } from '../initial_state'
import { SEARCH_FILTERS } from '../constants' import { SEARCH_FILTERS } from '../constants'
export const SEARCH_CHANGE = 'SEARCH_CHANGE'; export const SEARCH_CHANGE = 'SEARCH_CHANGE';
@ -37,6 +38,8 @@ export const clearSearch = () => ({
* *
*/ */
export const submitSearch = () => (dispatch, getState) => { export const submitSearch = () => (dispatch, getState) => {
if (!me) return
const value = getState().getIn(['search', 'value']) const value = getState().getIn(['search', 'value'])
const onlyVerified = getState().getIn(['search', 'filter', 'onlyVerified']) const onlyVerified = getState().getIn(['search', 'filter', 'onlyVerified'])