Use local instead of global loading indicator for timelines, account timelines (#9224)

So that opening a profile feels faster. Also, pinned toots are not
shown before other toots have loaded. Also, if no toots are loaded,
added empty message
This commit is contained in:
Eugen Rochko
2018-11-08 21:35:06 +01:00
committed by GitHub
parent f055907857
commit dd00cd19d2
5 changed files with 47 additions and 12 deletions

View File

@ -97,13 +97,12 @@ export const expandAccountTimeline = (accountId, { maxId, withReplies }
export const expandAccountFeaturedTimeline = accountId => expandTimeline(`account:${accountId}:pinned`, `/api/v1/accounts/${accountId}/statuses`, { pinned: true });
export const expandAccountMediaTimeline = (accountId, { maxId } = {}) => expandTimeline(`account:${accountId}:media`, `/api/v1/accounts/${accountId}/statuses`, { max_id: maxId, only_media: true });
export const expandListTimeline = (id, { maxId } = {}, done = noOp) => expandTimeline(`list:${id}`, `/api/v1/timelines/list/${id}`, { max_id: maxId }, done);
export const expandHashtagTimeline = (hashtag, { maxId, tags } = {}, done = noOp) => {
return expandTimeline(`hashtag:${hashtag}`, `/api/v1/timelines/tag/${hashtag}`, {
max_id: maxId,
any: parseTags(tags, 'any'),
all: parseTags(tags, 'all'),
none: parseTags(tags, 'none'),
any: parseTags(tags, 'any'),
all: parseTags(tags, 'all'),
none: parseTags(tags, 'none'),
}, done);
};
@ -111,6 +110,7 @@ export function expandTimelineRequest(timeline) {
return {
type: TIMELINE_EXPAND_REQUEST,
timeline,
skipLoading: true,
};
};
@ -121,6 +121,7 @@ export function expandTimelineSuccess(timeline, statuses, next, partial) {
statuses,
next,
partial,
skipLoading: true,
};
};
@ -129,6 +130,7 @@ export function expandTimelineFail(timeline, error) {
type: TIMELINE_EXPAND_FAIL,
timeline,
error,
skipLoading: true,
};
};