소스 검색

getExistingChannelHandles - filter our empty entities

Leszek Wiesner 4 년 전
부모
커밋
02446f18a7
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      cli/src/commands/media/createChannel.ts

+ 6 - 4
cli/src/commands/media/createChannel.ts

@@ -20,10 +20,12 @@ export default class CreateChannelCommand extends ContentDirectoryCommandBase {
   async getExistingChannelHandles(): Promise<string[]> {
   async getExistingChannelHandles(): Promise<string[]> {
     cli.action.start('Fetching chain data...')
     cli.action.start('Fetching chain data...')
     const result = await Promise.all(
     const result = await Promise.all(
-      (await this.entitiesByClassAndOwner('Channel')).map(async ([, channel]) => {
+      (await this.entitiesByClassAndOwner('Channel'))
-        const { handle } = await this.parseToEntityJson<ChannelEntity>(channel)
+        .filter(([, c]) => c.supported_schemas.toArray().length)
-        return handle
+        .map(async ([, channel]) => {
-      })
+          const { handle } = await this.parseToEntityJson<ChannelEntity>(channel)
+          return handle
+        })
     )
     )
     cli.action.stop()
     cli.action.stop()