Skip to content

Commit ecd6460

Browse files
committed
fix: command description
1 parent c07bb13 commit ecd6460

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/command/post/feed.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ async function renderPost(
6868
texts.push(`unsupported action: ${p.action}`)
6969
}
7070
} else if (p.type === ApiOptions.PostType.ORIGINAL) {
71-
const detail = p.detail
71+
const detail = p.detail as Entity.OriginalPost
7272
const link = isMacOS
7373
? logger.colors.gray(
7474
logger.colors.underline(`jike://page.jk/originalPost/${p.id}`)
@@ -83,7 +83,7 @@ async function renderPost(
8383
)
8484
if (detail.pictures && detail.pictures.length > 0) {
8585
const images = await Promise.all(
86-
(detail.pictures as Entity.Picture[]).map((p) =>
86+
detail.pictures.map((p) =>
8787
displayImage(p.middlePicUrl).then(({ result }) => `${result}\n`)
8888
)
8989
)

src/command/post/list.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createCommand } from 'commander'
2-
import { ApiOptions, limit } from 'jike-sdk'
2+
import { limit } from 'jike-sdk'
33
import { logger } from '@poppinss/cliui'
44
import { createClient, displayUser, filterUsers } from '../../utils/user'
55
import { displayImage, printIfRaw, renderDivider } from '../../utils/terminal'
@@ -13,7 +13,7 @@ interface ListOptions {
1313

1414
export const list = createCommand('list')
1515
.alias('ls')
16-
.description('feeds you are following')
16+
.description('view posts of user')
1717
.argument('[username]', 'the username of user')
1818
// TODO interactive next page, lastKey
1919
.option('-c, --count <count>', 'post max count', '30')
@@ -45,7 +45,7 @@ const listPosts = async (opts: ListOptions) => {
4545
async function renderPost(p: JikePostWithDetail) {
4646
const detail = p.getDetail()
4747
const texts: string[] = []
48-
if (p.type === ApiOptions.PostType.ORIGINAL) {
48+
if (detail.type === 'ORIGINAL_POST') {
4949
const link = isMacOS
5050
? logger.colors.gray(
5151
logger.colors.underline(`jike://page.jk/originalPost/${p.id}`)

0 commit comments

Comments
 (0)