From df56d2b0042ed3284305579b9a5fee28a09195d8 Mon Sep 17 00:00:00 2001 From: jessop Date: Tue, 16 Jul 2019 10:55:49 -0400 Subject: [PATCH] more cleanup --- src/ui/index.jsx | 50 +------------- src/ui/redux/actions/publish.js | 9 +-- src/ui/redux/reducers/publish.js | 108 +------------------------------ 3 files changed, 3 insertions(+), 164 deletions(-) diff --git a/src/ui/index.jsx b/src/ui/index.jsx index a0319324d..c7c62822a 100644 --- a/src/ui/index.jsx +++ b/src/ui/index.jsx @@ -12,16 +12,7 @@ import React, { useState, useEffect } from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { doConditionalAuthNavigate, doDaemonReady, doAutoUpdate, doOpenModal, doHideModal } from 'redux/actions/app'; -import { - Lbry, - doToast, - isURIValid, - setSearchApi, - // reduxCallbacks, - // batchActions, - // selectMyClaimsWithoutChannels, - // doError, -} from 'lbry-redux'; +import { Lbry, doToast, isURIValid, setSearchApi } from 'lbry-redux'; import { doInitLanguage, doUpdateIsNightAsync } from 'redux/actions/settings'; import { doAuthenticate, @@ -138,45 +129,6 @@ rewards.setCallback('claimRewardSuccess', () => { app.store.dispatch(doHideModal(MODALS.REWARD_APPROVAL_REQUIRED)); }); -// mimicking app.js.doOpenModal(id, modalProps {}) here -// reduxCallbacks.setCallback('streamPublishSuccess', successResponse => { -// const state = store.getState(); -// analytics.apiLogPublish(); -// const myClaims = selectMyClaimsWithoutChannels(state); -// const pendingClaim = successResponse.outputs[0]; -// const uri = pendingClaim.permanent_url; -// const actions = []; -// -// actions.push({ -// type: ACTIONS.PUBLISH_SUCCESS, -// }); -// -// // We have to fake a temp claim until the new pending one is returned by claim_list_mine -// // We can't rely on claim_list_mine because there might be some delay before the new claims are returned -// // Doing this allows us to show the pending claim immediately, it will get overwritten by the real one -// const isMatch = claim => claim.claim_id === pendingClaim.claim_id; -// const isEdit = myClaims.some(isMatch); -// -// const myNewClaims = isEdit -// ? myClaims.map(claim => (isMatch(claim) ? pendingClaim : claim)) -// : myClaims.concat(pendingClaim); -// -// actions.push(doOpenModal(MODALS.PUBLISH, { uri, isEdit })); -// -// actions.push({ -// type: ACTIONS.FETCH_CLAIM_LIST_MINE_COMPLETED, -// data: { -// claims: myNewClaims, -// }, -// }); -// -// store.dispatch(batchActions(...actions)); -// }); -// -// reduxCallbacks.setCallback('streamPublishFail', error => { -// store.dispatch({ type: ACTIONS.PUBLISH_FAIL }); -// store.dispatch(doError(error.message)); -// }); // @if TARGET='app' ipcRenderer.on('open-uri-requested', (event, uri, newSession) => { if (uri && uri.startsWith('lbry://')) { diff --git a/src/ui/redux/actions/publish.js b/src/ui/redux/actions/publish.js index 9409d4774..d130d822a 100644 --- a/src/ui/redux/actions/publish.js +++ b/src/ui/redux/actions/publish.js @@ -1,13 +1,6 @@ // @flow import * as MODALS from 'constants/modal_types'; -import { - batchActions, - // selectPendingById, - doError, - selectMyClaims, - doPublish, - doCheckPendingPublishes, -} from 'lbry-redux'; +import { batchActions, doError, selectMyClaims, doPublish, doCheckPendingPublishes } from 'lbry-redux'; import * as ACTIONS from 'constants/action_types'; import { selectosNotificationsEnabled } from 'redux/selectors/settings'; import { push } from 'connected-react-router'; diff --git a/src/ui/redux/reducers/publish.js b/src/ui/redux/reducers/publish.js index 6b4bcad56..d8ca50794 100644 --- a/src/ui/redux/reducers/publish.js +++ b/src/ui/redux/reducers/publish.js @@ -1,107 +1 @@ -// // @flow -// import { handleActions } from 'util/redux-utils'; -// import { buildURI } from 'lbry-redux'; -// import * as ACTIONS from 'constants/action_types'; -// import * as THUMBNAIL_STATUSES from 'constants/thumbnail_upload_statuses'; -// import { CHANNEL_ANONYMOUS } from 'constants/claim'; -// -// type PublishState = { -// editingURI: ?string, -// filePath: ?string, -// contentIsFree: boolean, -// fee: { -// amount: number, -// currency: string, -// }, -// title: string, -// thumbnail_url: string, -// thumbnailPath: string, -// uploadThumbnailStatus: string, -// description: string, -// language: string, -// channel: string, -// channelId: ?string, -// name: string, -// nameError: ?string, -// bid: number, -// bidError: ?string, -// otherLicenseDescription: string, -// licenseUrl: string, -// tags: Array, -// }; -// -// const defaultState: PublishState = { -// editingURI: undefined, -// filePath: undefined, -// contentIsFree: true, -// fee: { -// amount: 1, -// currency: 'LBC', -// }, -// title: '', -// thumbnail_url: '', -// thumbnailPath: '', -// uploadThumbnailStatus: THUMBNAIL_STATUSES.API_DOWN, -// description: '', -// language: 'en', -// nsfw: false, -// channel: CHANNEL_ANONYMOUS, -// channelId: '', -// name: '', -// nameError: undefined, -// bid: 0.1, -// bidError: undefined, -// licenseType: 'None', -// otherLicenseDescription: 'All rights reserved', -// licenseUrl: '', -// tags: [], -// publishing: false, -// publishSuccess: false, -// publishError: undefined, -// }; -// -// export default handleActions( -// { -// [ACTIONS.UPDATE_PUBLISH_FORM]: (state, action): PublishState => { -// const { data } = action; -// return { -// ...state, -// ...data, -// }; -// }, -// [ACTIONS.CLEAR_PUBLISH]: (): PublishState => ({ -// ...defaultState, -// }), -// [ACTIONS.PUBLISH_START]: (state: PublishState): PublishState => ({ -// ...state, -// publishing: true, -// }), -// [ACTIONS.PUBLISH_FAIL]: (state: PublishState): PublishState => ({ -// ...state, -// publishing: false, -// }), -// [ACTIONS.PUBLISH_SUCCESS]: (state: PublishState): PublishState => ({ -// ...state, -// publishing: false, -// }), -// [ACTIONS.DO_PREPARE_EDIT]: (state: PublishState, action) => { -// const { ...publishData } = action.data; -// const { channel, name, uri } = publishData; -// -// // The short uri is what is presented to the user -// // The editingUri is the full uri with claim id -// const shortUri = buildURI({ -// channelName: channel, -// contentName: name, -// }); -// -// return { -// ...defaultState, -// ...publishData, -// editingURI: uri, -// uri: shortUri, -// }; -// }, -// }, -// defaultState -// ); +// deleted, moved to lbry-redux