refactor: unify pagination helpers

This commit is contained in:
Peter Steinberger
2026-01-12 02:58:00 +00:00
parent e4d2773d46
commit d5a527d5fb
15 changed files with 307 additions and 182 deletions
+2 -2
View File
@@ -38,10 +38,10 @@ export function registerHomeCommand(program: Command, ctx: CliContext): void {
? await client.getHomeLatestTimeline(count, { includeRaw })
: await client.getHomeTimeline(count, { includeRaw });
if (result.success && result.tweets) {
if (result.success) {
const feedType = cmdOpts.following ? 'Following' : 'For You';
const emptyMessage = `No tweets found in ${feedType} timeline.`;
const isJson = cmdOpts.json || cmdOpts.jsonFull;
const isJson = Boolean(cmdOpts.json || cmdOpts.jsonFull);
ctx.printTweets(result.tweets, { json: isJson, emptyMessage });
} else {
console.error(`${ctx.p('err')}Failed to fetch home timeline: ${result.error}`);