more cleanup

This commit is contained in:
jessop 2019-07-16 10:55:49 -04:00 committed by Sean Yesmunt
parent 6ac727e19e
commit df56d2b004
3 changed files with 3 additions and 164 deletions

View file

@ -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://')) {

View file

@ -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';

View file

@ -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<string>,
// };
//
// 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