mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 12:13:48 +01:00
[mastodon-client] Fix global timeline
This commit is contained in:
parent
acff402e21
commit
197977c3a8
@ -45,13 +45,14 @@ export function apiTimelineMastodon(router: Router): void {
|
||||
const client = getClient(BASE_URL, accessTokens);
|
||||
try {
|
||||
const query: any = ctx.query;
|
||||
const data = query.local
|
||||
? await client.getLocalTimeline(
|
||||
convertTimelinesArgsId(argsToBools(limitToInt(query))),
|
||||
)
|
||||
: await client.getPublicTimeline(
|
||||
convertTimelinesArgsId(argsToBools(limitToInt(query))),
|
||||
);
|
||||
const data =
|
||||
query.local === "true"
|
||||
? await client.getLocalTimeline(
|
||||
convertTimelinesArgsId(argsToBools(limitToInt(query))),
|
||||
)
|
||||
: await client.getPublicTimeline(
|
||||
convertTimelinesArgsId(argsToBools(limitToInt(query))),
|
||||
);
|
||||
ctx.body = data.data.map((status) => convertStatus(status));
|
||||
} catch (e: any) {
|
||||
console.error(e);
|
||||
|
Loading…
Reference in New Issue
Block a user