From 35088a6d1007f877a33baf62d67b37669edea043 Mon Sep 17 00:00:00 2001 From: zeppi Date: Sun, 28 Mar 2021 20:53:51 -0400 Subject: [PATCH] add remote publish url --- dist/bundle.es.js | 7 ++++++- src/redux/actions/publish.js | 19 ++++++++++++------- src/redux/reducers/publish.js | 2 ++ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 8c8e247..14493ee 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -4777,7 +4777,8 @@ const doPublish = (success, fail, preview) => (dispatch, getState) => { tags, locations, optimize, - isLivestreamPublish + isLivestreamPublish, + remoteFileUrl } = publishData; // Handle scenario where we have a claim that has the same name as a channel we are publishing with. @@ -4812,6 +4813,9 @@ const doPublish = (success, fail, preview) => (dispatch, getState) => { // Temporary solution to keep the same publish flow with the new tags api // Eventually we will allow users to enter their own tags on publish // `nsfw` will probably be removed + if (remoteFileUrl) { + publishPayload.remote_url = remoteFileUrl; + } if (publishingLicense) { publishPayload.license = publishingLicense; @@ -5967,6 +5971,7 @@ const defaultState$4 = { fileDur: 0, fileSize: 0, fileVid: false, + remoteFileUrl: undefined, contentIsFree: true, fee: { amount: 1, diff --git a/src/redux/actions/publish.js b/src/redux/actions/publish.js index 52cba30..4732ebd 100644 --- a/src/redux/actions/publish.js +++ b/src/redux/actions/publish.js @@ -106,12 +106,12 @@ export const doUploadThumbnail = ( .then(json => { return json.success ? dispatch({ - type: ACTIONS.UPDATE_PUBLISH_FORM, - data: { - uploadThumbnailStatus: THUMBNAIL_STATUSES.COMPLETE, - thumbnail: json.data.serveUrl, - }, - }) + type: ACTIONS.UPDATE_PUBLISH_FORM, + data: { + uploadThumbnailStatus: THUMBNAIL_STATUSES.COMPLETE, + thumbnail: json.data.serveUrl, + }, + }) : uploadError(json.message || downMessage); }) .catch(err => { @@ -270,6 +270,7 @@ export const doPublish = (success: Function, fail: Function, preview: Function) locations, optimize, isLivestreamPublish, + remoteFileUrl, } = publishData; // Handle scenario where we have a claim that has the same name as a channel we are publishing with. @@ -309,6 +310,7 @@ export const doPublish = (success: Function, fail: Function, preview: Function) blocking: boolean, optimize_file?: boolean, preview?: boolean, + remote_url?: string, } = { name, title, @@ -324,6 +326,9 @@ export const doPublish = (success: Function, fail: Function, preview: Function) // Temporary solution to keep the same publish flow with the new tags api // Eventually we will allow users to enter their own tags on publish // `nsfw` will probably be removed + if (remoteFileUrl) { + publishPayload.remote_url = remoteFileUrl; + } if (publishingLicense) { publishPayload.license = publishingLicense; @@ -407,7 +412,7 @@ export const doCheckReflectingFiles = () => (dispatch: Dispatch, getState: GetSt const { checkingReflector } = state.claims; let reflectorCheckInterval; - const checkFileList = async() => { + const checkFileList = async () => { const state = getState(); const reflectingById = selectReflectingById(state); const ids = Object.keys(reflectingById); diff --git a/src/redux/reducers/publish.js b/src/redux/reducers/publish.js index 124f6cb..e89564d 100644 --- a/src/redux/reducers/publish.js +++ b/src/redux/reducers/publish.js @@ -9,6 +9,7 @@ type PublishState = { editingURI: ?string, fileText: ?string, filePath: ?string, + remoteFileUrl: ?string, contentIsFree: boolean, fileDur: number, fileSize: number, @@ -44,6 +45,7 @@ const defaultState: PublishState = { fileDur: 0, fileSize: 0, fileVid: false, + remoteFileUrl: undefined, contentIsFree: true, fee: { amount: 1, -- 2.45.2