Progress
hashtag in top of tag feed, scroll to comment, chat blocking, muting, filtering
This commit is contained in:
@@ -15,6 +15,13 @@ import {
|
||||
CHAT_CONVERSATIONS_REQUESTED_EXPAND_FAIL,
|
||||
|
||||
CHAT_CONVERSATION_REQUEST_APPROVE_SUCCESS,
|
||||
|
||||
CHAT_CONVERSATIONS_MUTED_FETCH_REQUEST,
|
||||
CHAT_CONVERSATIONS_MUTED_FETCH_SUCCESS,
|
||||
CHAT_CONVERSATIONS_MUTED_FETCH_FAIL,
|
||||
CHAT_CONVERSATIONS_MUTED_EXPAND_REQUEST,
|
||||
CHAT_CONVERSATIONS_MUTED_EXPAND_SUCCESS,
|
||||
CHAT_CONVERSATIONS_MUTED_EXPAND_FAIL,
|
||||
} from '../actions/chat_conversations'
|
||||
|
||||
const initialState = ImmutableMap({
|
||||
@@ -28,6 +35,11 @@ const initialState = ImmutableMap({
|
||||
isLoading: false,
|
||||
items: ImmutableList(),
|
||||
}),
|
||||
muted: ImmutableMap({
|
||||
next: null,
|
||||
isLoading: false,
|
||||
items: ImmutableList(),
|
||||
}),
|
||||
})
|
||||
|
||||
const normalizeList = (state, source, chatConversations, next) => {
|
||||
@@ -79,6 +91,18 @@ export default function chat_conversation_lists(state = initialState, action) {
|
||||
|
||||
case CHAT_CONVERSATION_REQUEST_APPROVE_SUCCESS:
|
||||
return removeOneFromList(state, 'requested', action.chatConversation.chat_conversation_id)
|
||||
|
||||
case CHAT_CONVERSATIONS_MUTED_FETCH_REQUEST:
|
||||
case CHAT_CONVERSATIONS_MUTED_EXPAND_REQUEST:
|
||||
return state.setIn(['muted', 'isLoading'], true)
|
||||
case CHAT_CONVERSATIONS_MUTED_FETCH_FAIL:
|
||||
case CHAT_CONVERSATIONS_MUTED_EXPAND_FAIL:
|
||||
return state.setIn(['muted', 'isLoading'], false)
|
||||
case CHAT_CONVERSATIONS_MUTED_FETCH_SUCCESS:
|
||||
return normalizeList(state, 'muted', action.chatConversations, action.next)
|
||||
case CHAT_CONVERSATIONS_MUTED_EXPAND_SUCCESS:
|
||||
return appendToList(state, 'muted', action.chatConversations, action.next)
|
||||
|
||||
default:
|
||||
return state
|
||||
}
|
||||
|
||||
@@ -17,9 +17,7 @@ const initialState = ImmutableMap({
|
||||
export default function chat_settings(state = initialState, action) {
|
||||
switch(action.type) {
|
||||
case CHAT_SETTING_CHANGE:
|
||||
return state
|
||||
.setIn(action.path, action.value)
|
||||
.set('saved', false)
|
||||
return state.set(action.path, action.checked).set('saved', false)
|
||||
default:
|
||||
return state
|
||||
}
|
||||
|
||||
20
app/javascript/gabsocial/reducers/hashtags.js
Normal file
20
app/javascript/gabsocial/reducers/hashtags.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import {
|
||||
HASHTAG_FETCH_REQUEST,
|
||||
HASHTAG_FETCH_SUCCESS,
|
||||
HASHTAG_FETCH_FAIL,
|
||||
} from '../actions/hashtags'
|
||||
import { Map as ImmutableMap, fromJS } from 'immutable'
|
||||
|
||||
const importHashtag = (state, hashtag) => state.set(`${hashtag.name}`.toLowerCase(), fromJS(hashtag))
|
||||
|
||||
const initialState = ImmutableMap()
|
||||
|
||||
export default function hashtags(state = initialState, action) {
|
||||
switch (action.type) {
|
||||
case HASHTAG_FETCH_SUCCESS:
|
||||
console.log("HASHTAG_FETCH_SUCCESS:", action)
|
||||
return importHashtag(state, action.hashtag)
|
||||
default:
|
||||
return state
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ import group_categories from './group_categories'
|
||||
import group_editor from './group_editor'
|
||||
import group_lists from './group_lists'
|
||||
import group_relationships from './group_relationships'
|
||||
import hashtags from './hashtags'
|
||||
import height_cache from './height_cache'
|
||||
import links from './links.js'
|
||||
import lists from './lists'
|
||||
@@ -75,6 +76,7 @@ const reducers = {
|
||||
group_editor,
|
||||
group_lists,
|
||||
group_relationships,
|
||||
hashtags,
|
||||
height_cache,
|
||||
links,
|
||||
lists,
|
||||
|
||||
Reference in New Issue
Block a user