From 4c6147efcc3823c4008b99cf4815952cb02aacc4 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 2 Jul 2019 13:47:42 -0400 Subject: [PATCH] add ChannelUpdateResponse type --- dist/flow-typed/Lbry.js | 15 ++++++++------- flow-typed/Lbry.js | 15 ++++++++------- src/redux/actions/claims.js | 2 +- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/dist/flow-typed/Lbry.js b/dist/flow-typed/Lbry.js index 6438792..bc02e1f 100644 --- a/dist/flow-typed/Lbry.js +++ b/dist/flow-typed/Lbry.js @@ -65,9 +65,7 @@ declare type VersionResponse = { declare type ResolveResponse = { // Keys are the url(s) passed to resolve - [string]: - | Claim - | { error?: {} }, + [string]: Claim | { error?: {} }, }; declare type GetResponse = FileListItem; @@ -105,6 +103,10 @@ declare type ChannelCreateResponse = GenericTxResponse & { outputs: Array, }; +declare type UpdateChannelResponse = GenericTxResponse & { + outputs: Array, +}; + declare type CommentCreateResponse = Comment; declare type CommentListResponse = Array; @@ -157,10 +159,10 @@ declare type LbryTypes = { connectPromise: ?Promise, connect: () => void, daemonConnectionString: string, - apiRequestHeaders: {[key: string]: string}, + apiRequestHeaders: { [key: string]: string }, setDaemonConnectionString: string => void, setApiHeader: (string, string) => void, - unsetApiHeader: (string) => void, + unsetApiHeader: string => void, overrides: { [string]: ?Function }, setOverride: (string, Function) => void, getMediaType: (string, ?string) => string, @@ -176,8 +178,7 @@ declare type LbryTypes = { claim_search: (params: {}) => Promise, claim_list: (params?: {}) => Promise, channel_create: (params: {}) => Promise, - // TODO fix this type: - channel_update: (params: {}) => Promise, + channel_update: (params: {}) => Promise, channel_list: () => Promise, stream_abandon: (params: {}) => Promise, channel_abandon: (params: {}) => Promise, diff --git a/flow-typed/Lbry.js b/flow-typed/Lbry.js index 6438792..335eda1 100644 --- a/flow-typed/Lbry.js +++ b/flow-typed/Lbry.js @@ -65,9 +65,7 @@ declare type VersionResponse = { declare type ResolveResponse = { // Keys are the url(s) passed to resolve - [string]: - | Claim - | { error?: {} }, + [string]: Claim | { error?: {} }, }; declare type GetResponse = FileListItem; @@ -105,6 +103,10 @@ declare type ChannelCreateResponse = GenericTxResponse & { outputs: Array, }; +declare type ChannelUpdateResponse = GenericTxResponse & { + outputs: Array, +}; + declare type CommentCreateResponse = Comment; declare type CommentListResponse = Array; @@ -157,10 +159,10 @@ declare type LbryTypes = { connectPromise: ?Promise, connect: () => void, daemonConnectionString: string, - apiRequestHeaders: {[key: string]: string}, + apiRequestHeaders: { [key: string]: string }, setDaemonConnectionString: string => void, setApiHeader: (string, string) => void, - unsetApiHeader: (string) => void, + unsetApiHeader: string => void, overrides: { [string]: ?Function }, setOverride: (string, Function) => void, getMediaType: (string, ?string) => string, @@ -176,8 +178,7 @@ declare type LbryTypes = { claim_search: (params: {}) => Promise, claim_list: (params?: {}) => Promise, channel_create: (params: {}) => Promise, - // TODO fix this type: - channel_update: (params: {}) => Promise, + channel_update: (params: {}) => Promise, channel_list: () => Promise, stream_abandon: (params: {}) => Promise, channel_abandon: (params: {}) => Promise, diff --git a/src/redux/actions/claims.js b/src/redux/actions/claims.js index f973890..51fd397 100644 --- a/src/redux/actions/claims.js +++ b/src/redux/actions/claims.js @@ -266,7 +266,7 @@ export function doUpdateChannel(params: any) { }; return Lbry.channel_update(updateParams) - .then((result: ChannelCreateResponse) => { + .then((result: ChannelUpdateResponse) => { const channelClaim = result.outputs[0]; dispatch({ type: ACTIONS.UPDATE_CHANNEL_COMPLETED,