forked from blisstown/campfire
feat: partial favourites
This commit is contained in:
parent
c51a0b1e5d
commit
99def58c8b
3 changed files with 81 additions and 8 deletions
|
@ -19,14 +19,27 @@ export async function getTimeline(timelineType = "home", clean, localOnly = fals
|
|||
if (!clean && get(timeline).length > 0)
|
||||
last_post = get(timeline)[get(timeline).length - 1].id;
|
||||
|
||||
const timeline_data = await api.getTimeline(
|
||||
get(server).host,
|
||||
get(app).token,
|
||||
timelineType,
|
||||
last_post,
|
||||
localOnly,
|
||||
remoteOnly
|
||||
);
|
||||
let timeline_data;
|
||||
switch(timelineType) {
|
||||
case "favourites":
|
||||
timeline_data = await api.getFavourites(
|
||||
get(server).host,
|
||||
get(app).token,
|
||||
last_post,
|
||||
)
|
||||
break;
|
||||
|
||||
default:
|
||||
timeline_data = await api.getTimeline(
|
||||
get(server).host,
|
||||
get(app).token,
|
||||
timelineType,
|
||||
last_post,
|
||||
localOnly,
|
||||
remoteOnly
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!timeline_data) {
|
||||
console.error(lang.string('logs.timeline_fetch_failed'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue