Remove lbryinc methods and upgrade lbry{inc,-redux} #2319
18 changed files with 51 additions and 125 deletions
|
@ -58,8 +58,8 @@
|
|||
"hast-util-sanitize": "^1.1.2",
|
||||
"keytar": "^4.3.0",
|
||||
"lbry-format": "https://github.com/lbryio/lbry-format.git",
|
||||
"lbry-redux": "lbryio/lbry-redux#406e1970b9d5594faf0407100c9bbed45d904cdf",
|
||||
"lbryinc": "lbryio/lbryinc#2334ad53e82c22d6291899785d5292347008f2a9",
|
||||
"lbry-redux": "lbryio/lbry-redux#71dda665759ead555fef0bccef3a0ae653cb4509",
|
||||
"lbryinc": "lbryio/lbryinc#b54e90f3d497f0d91b3bb94dab063f0696775169",
|
||||
"localforage": "^1.7.1",
|
||||
"mammoth": "^1.4.6",
|
||||
"mime": "^2.3.1",
|
||||
|
|
|
@ -4,16 +4,11 @@ import * as ICONS from 'constants/icons';
|
|||
import React from 'react';
|
||||
import Button from 'component/button';
|
||||
import parseData from 'util/parse-data';
|
||||
/* eslint-disable no-redeclare */
|
||||
// @if TARGET='app'
|
||||
// $FlowFixMe
|
||||
import { remote } from 'electron';
|
||||
import path from 'path';
|
||||
// @if TARGET='app'
|
||||
import fs from 'fs';
|
||||
// @endif
|
||||
// @if TARGET='web'
|
||||
// $FlowFixMe
|
||||
import { remote } from 'web/stubs';
|
||||
// @endif
|
||||
/* eslint-enable no-redeclare */
|
||||
|
||||
type Props = {
|
||||
data: Array<any>,
|
||||
|
@ -34,8 +29,6 @@ class FileExporter extends React.PureComponent<Props> {
|
|||
this.handleButtonClick = this.handleButtonClick.bind(this);
|
||||
}
|
||||
|
||||
handleButtonClick: () => void;
|
||||
|
||||
handleFileCreation(filename: string, data: any) {
|
||||
const { onFileCreated } = this.props;
|
||||
// @if TARGET='app'
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
import { connect } from 'react-redux';
|
||||
import {
|
||||
makeSelectCostInfoForUri,
|
||||
makeSelectFileInfoForUri,
|
||||
makeSelectClaimIsMine,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectFileInfoForUri, makeSelectClaimIsMine } from 'lbry-redux';
|
||||
import { makeSelectCostInfoForUri } from 'lbryinc';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import FileActions from './view';
|
||||
|
||||
|
|
|
@ -8,11 +8,9 @@ import {
|
|||
makeSelectClaimIsMine,
|
||||
makeSelectClaimIsPending,
|
||||
} from 'lbry-redux';
|
||||
import { selectRewardContentClaimIds } from 'lbryinc';
|
||||
import { doNavigate } from 'redux/actions/navigation';
|
||||
import {
|
||||
selectRewardContentClaimIds,
|
||||
makeSelectContentPositionForUri,
|
||||
} from 'redux/selectors/content';
|
||||
import { makeSelectContentPositionForUri } from 'redux/selectors/content';
|
||||
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||
import { makeSelectIsSubscribed, makeSelectIsNew } from 'redux/selectors/subscriptions';
|
||||
import { doClearContentHistoryUri } from 'redux/actions/content';
|
||||
|
|
|
@ -3,9 +3,9 @@ import {
|
|||
makeSelectFileInfoForUri,
|
||||
makeSelectDownloadingForUri,
|
||||
makeSelectLoadingForUri,
|
||||
makeSelectCostInfoForUri,
|
||||
makeSelectClaimForUri,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectCostInfoForUri } from 'lbryinc';
|
||||
import { doOpenFileInShell } from 'redux/actions/file';
|
||||
import { doPurchaseUri, doStartDownload, doSetPlayingUri } from 'redux/actions/content';
|
||||
import FileDownloadLink from './view';
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimForUri } from 'lbry-redux';
|
||||
import {
|
||||
doFetchCostInfoForUri,
|
||||
makeSelectCostInfoForUri,
|
||||
doFetchCostInfoForUri,
|
||||
makeSelectFetchingCostInfoForUri,
|
||||
makeSelectClaimForUri,
|
||||
} from 'lbry-redux';
|
||||
} from 'lbryinc';
|
||||
import FilePrice from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
|
|
|
@ -7,10 +7,10 @@ import {
|
|||
makeSelectIsUriResolving,
|
||||
makeSelectClaimIsMine,
|
||||
} from 'lbry-redux';
|
||||
import { selectRewardContentClaimIds } from 'lbryinc';
|
||||
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||
import { doNavigate } from 'redux/actions/navigation';
|
||||
import { doClearPublish, doUpdatePublishForm } from 'redux/actions/publish';
|
||||
import { selectRewardContentClaimIds } from 'redux/selectors/content';
|
||||
import { makeSelectIsSubscribed, makeSelectIsNew } from 'redux/selectors/subscriptions';
|
||||
import FileTile from './view';
|
||||
|
||||
|
|
|
@ -4,11 +4,10 @@ import { doChangeVolume } from 'redux/actions/app';
|
|||
import { selectVolume } from 'redux/selectors/app';
|
||||
import { doPlayUri, doSetPlayingUri, savePosition } from 'redux/actions/content';
|
||||
import { doNavigate } from 'redux/actions/navigation';
|
||||
import { doClaimEligiblePurchaseRewards } from 'lbryinc';
|
||||
import { doClaimEligiblePurchaseRewards, makeSelectCostInfoForUri } from 'lbryinc';
|
||||
import {
|
||||
makeSelectMetadataForUri,
|
||||
makeSelectContentTypeForUri,
|
||||
makeSelectCostInfoForUri,
|
||||
makeSelectClaimForUri,
|
||||
makeSelectFileInfoForUri,
|
||||
makeSelectLoadingForUri,
|
||||
|
|
|
@ -18,16 +18,10 @@ import {
|
|||
doOpenModal,
|
||||
doHideModal,
|
||||
} from 'redux/actions/app';
|
||||
import {
|
||||
Lbry,
|
||||
doToast,
|
||||
doBlackListedOutpointsSubscribe,
|
||||
isURIValid,
|
||||
setSearchApi,
|
||||
} from 'lbry-redux';
|
||||
import { Lbry, doToast, isURIValid, setSearchApi } from 'lbry-redux';
|
||||
import { doNavigate, doHistoryBack, doHistoryForward } from 'redux/actions/navigation';
|
||||
import { doDownloadLanguages, doUpdateIsNightAsync } from 'redux/actions/settings';
|
||||
import { doAuthenticate, Lbryio, rewards } from 'lbryinc';
|
||||
import { doAuthenticate, Lbryio, rewards, doBlackListedOutpointsSubscribe } from 'lbryinc';
|
||||
import 'scss/all.scss';
|
||||
import store from 'store';
|
||||
import pjson from 'package.json';
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
import { connect } from 'react-redux';
|
||||
import * as settings from 'constants/settings';
|
||||
import {
|
||||
selectCostForCurrentPageUri,
|
||||
selectBalance,
|
||||
selectCurrentPage,
|
||||
selectError,
|
||||
doToast,
|
||||
} from 'lbry-redux';
|
||||
import { selectBalance, selectCurrentPage, selectError, doToast } from 'lbry-redux';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import { selectUser, selectUserIsVerificationCandidate } from 'lbryinc';
|
||||
import {
|
||||
selectUser,
|
||||
selectUserIsVerificationCandidate,
|
||||
selectCostForCurrentPageUri,
|
||||
} from 'lbryinc';
|
||||
import { selectModal } from 'redux/selectors/app';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import ModalRouter from './view';
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { selectFeaturedUris, selectFetchingFeaturedUris, doFetchFeaturedUris } from 'lbry-redux';
|
||||
import { doFetchRewardedContent, doRewardList } from 'lbryinc';
|
||||
import {
|
||||
doFetchRewardedContent,
|
||||
doRewardList,
|
||||
selectFeaturedUris,
|
||||
doFetchFeaturedUris,
|
||||
selectFetchingFeaturedUris,
|
||||
} from 'lbryinc';
|
||||
import DiscoverPage from './view';
|
||||
|
||||
const select = state => ({
|
||||
|
|
|
@ -7,15 +7,14 @@ import { doSetClientSetting } from 'redux/actions/settings';
|
|||
import { doSetContentHistoryItem } from 'redux/actions/content';
|
||||
import {
|
||||
doFetchFileInfo,
|
||||
doFetchCostInfoForUri,
|
||||
makeSelectClaimIsMine,
|
||||
makeSelectCostInfoForUri,
|
||||
makeSelectFileInfoForUri,
|
||||
makeSelectClaimForUri,
|
||||
makeSelectContentTypeForUri,
|
||||
makeSelectMetadataForUri,
|
||||
makeSelectChannelForClaimUri,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectCostInfoForUri, doFetchCostInfoForUri } from 'lbryinc';
|
||||
import { selectShowNsfw, makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
|
||||
import { doPrepareEdit } from 'redux/actions/publish';
|
||||
|
|
|
@ -5,8 +5,8 @@ import {
|
|||
makeSelectClaimForUri,
|
||||
makeSelectIsUriResolving,
|
||||
makeSelectTotalPagesForChannel,
|
||||
selectBlackListedOutpoints,
|
||||
} from 'lbry-redux';
|
||||
import { selectBlackListedOutpoints } from 'lbryinc';
|
||||
import ShowPage from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
|
|
|
@ -16,7 +16,6 @@ import {
|
|||
Lbry,
|
||||
Lbryapi,
|
||||
buildURI,
|
||||
makeSelectCostInfoForUri,
|
||||
makeSelectFileInfoForUri,
|
||||
selectFileInfosByOutpoint,
|
||||
selectDownloadingByOutpoint,
|
||||
|
@ -26,6 +25,8 @@ import {
|
|||
creditsToString,
|
||||
doError,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectCostInfoForUri } from 'lbryinc';
|
||||
|
||||
import { makeSelectClientSetting, selectosNotificationsEnabled } from 'redux/selectors/settings';
|
||||
import setBadge from 'util/set-badge';
|
||||
import analytics from 'analytics';
|
||||
|
|
|
@ -3,68 +3,11 @@ import * as ACTIONS from 'constants/action_types';
|
|||
const reducers = {};
|
||||
const defaultState = {
|
||||
playingUri: null,
|
||||
rewardedContentClaimIds: [],
|
||||
channelClaimCounts: {},
|
||||
positions: {},
|
||||
history: [],
|
||||
};
|
||||
|
||||
reducers[ACTIONS.FETCH_FEATURED_CONTENT_STARTED] = state =>
|
||||
Object.assign({}, state, {
|
||||
fetchingFeaturedContent: true,
|
||||
});
|
||||
|
||||
reducers[ACTIONS.FETCH_FEATURED_CONTENT_COMPLETED] = (state, action) => {
|
||||
const { uris, success } = action.data;
|
||||
|
||||
return Object.assign({}, state, {
|
||||
fetchingFeaturedContent: false,
|
||||
fetchingFeaturedContentFailed: !success,
|
||||
featuredUris: uris,
|
||||
});
|
||||
};
|
||||
|
||||
reducers[ACTIONS.FETCH_REWARD_CONTENT_COMPLETED] = (state, action) => {
|
||||
const { claimIds } = action.data;
|
||||
|
||||
return Object.assign({}, state, {
|
||||
rewardedContentClaimIds: claimIds,
|
||||
});
|
||||
};
|
||||
|
||||
reducers[ACTIONS.RESOLVE_URIS_STARTED] = (state, action) => {
|
||||
const { uris } = action.data;
|
||||
|
||||
const oldResolving = state.resolvingUris || [];
|
||||
const newResolving = Object.assign([], oldResolving);
|
||||
|
||||
uris.forEach(uri => {
|
||||
if (!newResolving.includes(uri)) {
|
||||
newResolving.push(uri);
|
||||
}
|
||||
});
|
||||
|
||||
return Object.assign({}, state, {
|
||||
resolvingUris: newResolving,
|
||||
});
|
||||
};
|
||||
|
||||
reducers[ACTIONS.RESOLVE_URIS_COMPLETED] = (state, action) => {
|
||||
const { resolveInfo } = action.data;
|
||||
const channelClaimCounts = Object.assign({}, state.channelClaimCounts);
|
||||
|
||||
Object.entries(resolveInfo).forEach(([uri, { certificate, claimsInChannel }]) => {
|
||||
if (certificate && !Number.isNaN(claimsInChannel)) {
|
||||
channelClaimCounts[uri] = claimsInChannel;
|
||||
}
|
||||
});
|
||||
|
||||
return Object.assign({}, state, {
|
||||
channelClaimCounts,
|
||||
resolvingUris: (state.resolvingUris || []).filter(uri => !resolveInfo[uri]),
|
||||
});
|
||||
};
|
||||
|
||||
reducers[ACTIONS.SET_PLAYING_URI] = (state, action) =>
|
||||
Object.assign({}, state, {
|
||||
playingUri: action.data.uri,
|
||||
|
|
|
@ -3,16 +3,20 @@ import availabilityReducer from 'redux/reducers/availability';
|
|||
import contentReducer from 'redux/reducers/content';
|
||||
import {
|
||||
claimsReducer,
|
||||
costInfoReducer,
|
||||
fileInfoReducer,
|
||||
searchReducer,
|
||||
walletReducer,
|
||||
notificationsReducer,
|
||||
blacklistReducer,
|
||||
} from 'lbry-redux';
|
||||
import {
|
||||
userReducer,
|
||||
rewardsReducer,
|
||||
costInfoReducer,
|
||||
blacklistReducer,
|
||||
homepageReducer,
|
||||
} from 'lbryinc';
|
||||
import navigationReducer from 'redux/reducers/navigation';
|
||||
import settingsReducer from 'redux/reducers/settings';
|
||||
import { userReducer, rewardsReducer } from 'lbryinc';
|
||||
import shapeShiftReducer from 'redux/reducers/shape_shift';
|
||||
import subscriptionsReducer from 'redux/reducers/subscriptions';
|
||||
import publishReducer from 'redux/reducers/publish';
|
||||
|
@ -69,6 +73,7 @@ const reducers = combineReducers({
|
|||
publish: publishReducer,
|
||||
notifications: notificationsReducer,
|
||||
blacklist: blacklistReducer,
|
||||
homepage: homepageReducer,
|
||||
});
|
||||
|
||||
const bulkThunk = createBulkThunkMiddleware();
|
||||
|
|
|
@ -3,7 +3,9 @@ const merge = require('webpack-merge');
|
|||
const { DefinePlugin, ProvidePlugin } = require('webpack');
|
||||
const { getIfUtils, removeEmpty } = require('webpack-config-utils');
|
||||
|
||||
const { ifProduction } = getIfUtils(process.env.NODE_ENV || 'development');
|
||||
const NODE_ENV = process.env.NODE_ENV || 'development';
|
||||
|
||||
const { ifProduction } = getIfUtils(NODE_ENV);
|
||||
|
||||
const UI_ROOT = path.resolve(__dirname, 'src/ui/');
|
||||
const STATIC_ROOT = path.resolve(__dirname, 'static/');
|
||||
|
@ -76,8 +78,9 @@ const baseConfig = {
|
|||
}),
|
||||
new DefinePlugin({
|
||||
__static: `"${path.join(__dirname, 'static').replace(/\\/g, '\\\\')}"`,
|
||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
||||
'process.env.NODE_ENV': JSON.stringify(NODE_ENV),
|
||||
'process.env.SDK_API_URL': JSON.stringify(process.env.SDK_API_URL),
|
||||
'process.env.LBRY_API_URL': JSON.stringify(process.env.LBRY_API_URL),
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
|
17
yarn.lock
17
yarn.lock
|
@ -5962,28 +5962,19 @@ lazy-val@^1.0.3, lazy-val@^1.0.4:
|
|||
tar-stream "^1.6.2"
|
||||
zstd-codec "^0.1.1"
|
||||
|
||||
lbry-redux@lbryio/lbry-redux#406e1970b9d5594faf0407100c9bbed45d904cdf:
|
||||
lbry-redux@lbryio/lbry-redux#71dda665759ead555fef0bccef3a0ae653cb4509:
|
||||
version "0.0.1"
|
||||
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/406e1970b9d5594faf0407100c9bbed45d904cdf"
|
||||
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/71dda665759ead555fef0bccef3a0ae653cb4509"
|
||||
dependencies:
|
||||
proxy-polyfill "0.1.6"
|
||||
reselect "^3.0.0"
|
||||
uuid "^3.3.2"
|
||||
|
||||
lbry-redux@lbryio/lbry-redux#76d8bbef9640bf8ea5c4f45550e55b77d3944ee3:
|
||||
lbryinc@lbryio/lbryinc#b54e90f3d497f0d91b3bb94dab063f0696775169:
|
||||
version "0.0.1"
|
||||
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/76d8bbef9640bf8ea5c4f45550e55b77d3944ee3"
|
||||
dependencies:
|
||||
proxy-polyfill "0.1.6"
|
||||
reselect "^3.0.0"
|
||||
uuid "^3.3.2"
|
||||
|
||||
lbryinc@lbryio/lbryinc#2334ad53e82c22d6291899785d5292347008f2a9:
|
||||
version "0.0.1"
|
||||
resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/2334ad53e82c22d6291899785d5292347008f2a9"
|
||||
resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/b54e90f3d497f0d91b3bb94dab063f0696775169"
|
||||
dependencies:
|
||||
bluebird "^3.5.1"
|
||||
lbry-redux lbryio/lbry-redux#76d8bbef9640bf8ea5c4f45550e55b77d3944ee3
|
||||
reselect "^3.0.0"
|
||||
|
||||
lcid@^1.0.0:
|
||||
|
|
Loading…
Reference in a new issue