Fixed issue with timeline, accounts being fetched with undefined/null id

• Fixed:
- issue with timeline, accounts being fetched with undefined/null id
This commit is contained in:
mgabdev 2020-12-22 23:52:59 -05:00
parent 7142375c0b
commit 70893b7e4c
2 changed files with 3 additions and 0 deletions

View File

@ -97,6 +97,7 @@ function getFromDB(dispatch, getState, index, id) {
*/
export const fetchAccount = (id) => (dispatch, getState) => {
if (id === -1 || getState().getIn(['accounts', id], null) !== null) return
if (!id) return
dispatch(fetchRelationships([id]))
dispatch(fetchAccountRequest(id))

View File

@ -260,6 +260,8 @@ export const expandCommunityTimeline = ({ maxId, onlyMedia } = {}, done = noop)
*
*/
export const expandAccountTimeline = (accountId, { maxId, withReplies, commentsOnly } = {}) => {
if (!accountId) return
let key = `account:${accountId}${withReplies ? ':with_replies' : ''}${commentsOnly ? ':comments_only' : ''}`
return expandTimeline(key, `/api/v1/accounts/${accountId}/statuses`, {
only_comments: commentsOnly,