From 06531c6b488b2b5abd9b27f16095ecce4a756228 Mon Sep 17 00:00:00 2001 From: zeppi Date: Sun, 30 May 2021 18:26:53 -0400 Subject: [PATCH] fix tags bug, flow --- dist/bundle.es.js | 21 +++++++++++++++++++-- src/redux/actions/claims.js | 37 ++++++++++++++++++++++++++++++++----- 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 317ee85..0ae9e09 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -4313,7 +4313,6 @@ function doClaimSearch(options = { function doRepost(options) { return dispatch => { - // $FlowFixMe return new Promise(resolve => { dispatch({ type: CLAIM_REPOST_STARTED @@ -4356,6 +4355,24 @@ function doRepost(options) { function doCollectionPublish(options, localId) { return dispatch => { // $FlowFixMe + + const params = { + name: options.name, + bid: creditsToString(options.bid), + title: options.title, + thumbnail_url: options.thumbnail_url, + description: options.description, + tags: [], + languages: options.languages || [], + locations: [], + blocking: true, + claims: options.claims + }; + + if (options.tags) { + params['tags'] = options.tags.map(tag => tag.name); + } + return new Promise(resolve => { dispatch({ type: COLLECTION_PUBLISH_STARTED @@ -4392,7 +4409,7 @@ function doCollectionPublish(options, localId) { }); } - lbryProxy.collection_create(options).then(success, failure); + lbryProxy.collection_create(params).then(success, failure); }); }; } diff --git a/src/redux/actions/claims.js b/src/redux/actions/claims.js index 410a411..c83dedc 100644 --- a/src/redux/actions/claims.js +++ b/src/redux/actions/claims.js @@ -701,8 +701,7 @@ export function doClaimSearch( } export function doRepost(options: StreamRepostOptions) { - return (dispatch: Dispatch) => { - // $FlowFixMe + return (dispatch: Dispatch): Promise => { return new Promise(resolve => { dispatch({ type: ACTIONS.CLAIM_REPOST_STARTED, @@ -751,14 +750,42 @@ export function doCollectionPublish( channel_id?: string, thumbnail_url?: string, description?: string, - tags?: Array, + tags?: Array, languages?: Array, claims: Array, }, localId: string ) { - return (dispatch: Dispatch) => { + return (dispatch: Dispatch): Promise => { // $FlowFixMe + + const params: { + name: string, + bid: string, + blocking?: true, + title?: string, + thumbnail_url?: string, + description?: string, + tags?: Array, + languages?: Array, + claims: Array, + } = { + name: options.name, + bid: creditsToString(options.bid), + title: options.title, + thumbnail_url: options.thumbnail_url, + description: options.description, + tags: [], + languages: options.languages || [], + locations: [], + blocking: true, + claims: options.claims, + }; + + if (options.tags) { + params['tags'] = options.tags.map(tag => tag.name); + } + return new Promise(resolve => { dispatch({ type: ACTIONS.COLLECTION_PUBLISH_STARTED, @@ -800,7 +827,7 @@ export function doCollectionPublish( }); } - Lbry.collection_create(options).then(success, failure); + Lbry.collection_create(params).then(success, failure); }); }; }