Report modal style fix, chat updates, statusserializer revert, display name truncation
This commit is contained in:
mgabdev
2020-12-20 12:27:24 -05:00
parent 7ec426e3d8
commit 67eb9d5890
49 changed files with 369 additions and 158 deletions

View File

@@ -162,7 +162,6 @@ export const followAccount = (id, reblogs = true) => (dispatch, getState) => {
dispatch(followAccountRequest(id, locked))
api(getState).post(`/api/v1/accounts/${id}/follow`, { reblogs }).then((response) => {
console.log("response:", response)
dispatch(followAccountSuccess(response.data, alreadyFollowing))
}).catch((error) => {
dispatch(followAccountFail(error, locked))

View File

@@ -258,7 +258,6 @@ export const deleteChatConversation = (chatConversationId) => (dispatch, getStat
dispatch(deleteChatConversationRequest(conversationId))
api(getState).delete(`/api/v1/chat_conversation/${chatConversationId}`).then((response) => {
console.log("chat_conversations delete response: ", response)
dispatch(deleteChatConversationSuccess())
}).catch((error) => {
dispatch(deleteChatConversationFail(error))

View File

@@ -62,11 +62,9 @@ const sendChatMessageFail = (error) => ({
export const manageIncomingChatMessage = (chatMessage) => (dispatch, getState) => {
if (!chatMessage) return
console.log("chatMessage:", chatMessage)
dispatch(sendChatMessageSuccess(chatMessage))
const isOnline = getState().getIn(['chat_conversation_messages', chatMessage.chat_conversation_id, 'online'])
console.log("isOnline: ", isOnline)
// : todo :
// Check if is online for conversation, if not increase total/convo unread count

View File

@@ -0,0 +1,35 @@
import api from '../api'
import debounce from 'lodash.debounce'
import { me } from '../initial_state'
export const CHAT_SETTING_CHANGE = 'CHAT_SETTING_CHANGE'
export const CHAT_SETTING_SAVE = 'CHAT_SETTING_SAVE'
export const changeChatSetting = (path, value) => (dispatch) => {
dispatch({
type: CHAT_SETTING_CHANGE,
path,
value,
})
dispatch(saveChatSettings())
}
/**
*
*/
export const saveChatSettings = () => (dispatch, getState) => {
debouncedChatSettingsSave(dispatch, getState)
}
const debouncedChatSettingsSave = debounce((dispatch, getState) => {
if (!me) return
if (getState().getIn(['chat_settings', 'saved'])) return
const data = getState().get('chat_settings').filter((_, path) => path !== 'saved').toJS()
api().put('/api/web/chat_settings', { data })
.then(() => dispatch({ type: CHAT_SETTING_SAVE }))
.catch(() => { /* */ })
}, 350, { trailing: true })

View File

@@ -151,7 +151,6 @@ export const expandTimeline = (timelineId, path, params = {}, done = noop) => (d
dispatch(expandTimelineRequest(timelineId, isLoadingMore))
api(getState).get(path, { params }).then((response) => {
console.log("response:", response)
const next = getLinks(response).refs.find(link => link.rel === 'next')
dispatch(importFetchedStatuses(response.data))
dispatch(expandTimelineSuccess(timelineId, response.data, next ? next.uri : null, response.code === 206, isLoadingRecent, isLoadingMore))