General bug fixes #1353
52 changed files with 26888 additions and 213 deletions
26722
package-lock.json
generated
Normal file
26722
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,7 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doShowSnackBar } from 'redux/actions/app';
|
import { doNotify } from 'lbry-redux';
|
||||||
import Address from './view';
|
import Address from './view';
|
||||||
|
|
||||||
export default connect(null, {
|
export default connect(null, {
|
||||||
doShowSnackBar,
|
doNotify,
|
||||||
})(Address);
|
})(Address);
|
||||||
|
|
|
@ -7,7 +7,7 @@ import * as icons from 'constants/icons';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
address: string,
|
address: string,
|
||||||
doShowSnackBar: ({ message: string }) => void,
|
doNotify: ({ message: string, displayType: Array<string> }) => void,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class Address extends React.PureComponent<Props> {
|
export default class Address extends React.PureComponent<Props> {
|
||||||
|
@ -20,7 +20,7 @@ export default class Address extends React.PureComponent<Props> {
|
||||||
input: ?HTMLInputElement;
|
input: ?HTMLInputElement;
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { address, doShowSnackBar } = this.props;
|
const { address, doNotify } = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormRow verticallyCentered padded stretch>
|
<FormRow verticallyCentered padded stretch>
|
||||||
|
@ -43,7 +43,10 @@ export default class Address extends React.PureComponent<Props> {
|
||||||
icon={icons.CLIPBOARD}
|
icon={icons.CLIPBOARD}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
clipboard.writeText(address);
|
clipboard.writeText(address);
|
||||||
doShowSnackBar({ message: __('Address copied') });
|
doNotify({
|
||||||
|
message: __('Address copied'),
|
||||||
|
displayType: ['snackbar']
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</FormRow>
|
</FormRow>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doOpenModal } from 'redux/actions/app';
|
|
||||||
import {
|
import {
|
||||||
makeSelectCostInfoForUri,
|
makeSelectCostInfoForUri,
|
||||||
makeSelectFileInfoForUri,
|
makeSelectFileInfoForUri,
|
||||||
makeSelectClaimIsMine,
|
makeSelectClaimIsMine,
|
||||||
|
doNotify,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import FileActions from './view';
|
import FileActions from './view';
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ const select = (state, props) => ({
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
openModal: (modal, props) => dispatch(doNotify(modal, props)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(select, perform)(FileActions);
|
export default connect(select, perform)(FileActions);
|
||||||
|
|
|
@ -12,7 +12,7 @@ type FileInfo = {
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
uri: string,
|
uri: string,
|
||||||
openModal: (string, any) => void,
|
openModal: ({ id: string }, { uri: string }) => void,
|
||||||
claimIsMine: boolean,
|
claimIsMine: boolean,
|
||||||
fileInfo: FileInfo,
|
fileInfo: FileInfo,
|
||||||
vertical?: boolean, // should the buttons be stacked vertically?
|
vertical?: boolean, // should the buttons be stacked vertically?
|
||||||
|
@ -33,7 +33,7 @@ class FileActions extends React.PureComponent<Props> {
|
||||||
className="btn--file-actions"
|
className="btn--file-actions"
|
||||||
icon={icons.TRASH}
|
icon={icons.TRASH}
|
||||||
description={__('Delete')}
|
description={__('Delete')}
|
||||||
onClick={() => openModal(modals.CONFIRM_FILE_REMOVE, { uri })}
|
onClick={() => openModal({ id: modals.CONFIRM_FILE_REMOVE }, { uri })}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{!claimIsMine && (
|
{!claimIsMine && (
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {
|
||||||
clearShapeShift,
|
clearShapeShift,
|
||||||
getActiveShift,
|
getActiveShift,
|
||||||
} from 'redux/actions/shape_shift';
|
} from 'redux/actions/shape_shift';
|
||||||
import { doShowSnackBar, selectReceiveAddress } from 'lbry-redux';
|
import { selectReceiveAddress } from 'lbry-redux';
|
||||||
import { selectShapeShift } from 'redux/selectors/shape_shift';
|
import { selectShapeShift } from 'redux/selectors/shape_shift';
|
||||||
import ShapeShift from './view';
|
import ShapeShift from './view';
|
||||||
|
|
||||||
|
@ -21,5 +21,4 @@ export default connect(select, {
|
||||||
createShapeShift,
|
createShapeShift,
|
||||||
clearShapeShift,
|
clearShapeShift,
|
||||||
getActiveShift,
|
getActiveShift,
|
||||||
doShowSnackBar,
|
|
||||||
})(ShapeShift);
|
})(ShapeShift);
|
||||||
|
|
|
@ -14,7 +14,6 @@ type Props = {
|
||||||
createShapeShift: Dispatch,
|
createShapeShift: Dispatch,
|
||||||
clearShapeShift: Dispatch,
|
clearShapeShift: Dispatch,
|
||||||
getActiveShift: Dispatch,
|
getActiveShift: Dispatch,
|
||||||
doShowSnackBar: Dispatch,
|
|
||||||
shapeShiftInit: Dispatch,
|
shapeShiftInit: Dispatch,
|
||||||
receiveAddress: string,
|
receiveAddress: string,
|
||||||
};
|
};
|
||||||
|
@ -37,7 +36,6 @@ class ShapeShift extends React.PureComponent<Props> {
|
||||||
shapeShift,
|
shapeShift,
|
||||||
clearShapeShift,
|
clearShapeShift,
|
||||||
getActiveShift,
|
getActiveShift,
|
||||||
doShowSnackBar,
|
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
@ -107,7 +105,6 @@ class ShapeShift extends React.PureComponent<Props> {
|
||||||
shiftOrderId={shiftOrderId}
|
shiftOrderId={shiftOrderId}
|
||||||
shiftState={shiftState}
|
shiftState={shiftState}
|
||||||
clearShapeShift={clearShapeShift}
|
clearShapeShift={clearShapeShift}
|
||||||
doShowSnackBar={doShowSnackBar}
|
|
||||||
originCoinDepositMax={originCoinDepositMax}
|
originCoinDepositMax={originCoinDepositMax}
|
||||||
originCoinDepositMin={originCoinDepositMin}
|
originCoinDepositMin={originCoinDepositMin}
|
||||||
originCoinDepositFee={originCoinDepositFee}
|
originCoinDepositFee={originCoinDepositFee}
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doRemoveSnackBarSnack } from 'redux/actions/app';
|
import { selectSnack, doHideNotification } from 'lbry-redux';
|
||||||
import { selectSnackBarSnacks } from 'redux/selectors/app';
|
|
||||||
import SnackBar from './view';
|
import SnackBar from './view';
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
removeSnack: () => dispatch(doRemoveSnackBarSnack()),
|
removeSnack: () => dispatch(doHideNotification()),
|
||||||
});
|
});
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
snacks: selectSnackBarSnacks(state),
|
snack: selectSnack(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(select, perform)(SnackBar);
|
export default connect(select, perform)(SnackBar);
|
||||||
|
|
|
@ -4,7 +4,7 @@ import Button from 'component/button';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
removeSnack: any => void,
|
removeSnack: any => void,
|
||||||
snacks: {
|
snack: ?{
|
||||||
linkTarget: ?string,
|
linkTarget: ?string,
|
||||||
linkText: ?string,
|
linkText: ?string,
|
||||||
message: string,
|
message: string,
|
||||||
|
@ -20,14 +20,13 @@ class SnackBar extends React.PureComponent<Props> {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { snacks, removeSnack } = this.props;
|
const { snack, removeSnack } = this.props;
|
||||||
|
|
||||||
if (!snacks.length) {
|
if (!snack) {
|
||||||
this.hideTimeout = null; // should be unmounting anyway, but be safe?
|
this.hideTimeout = null; // should be unmounting anyway, but be safe?
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const snack = snacks[0];
|
|
||||||
const { message, linkText, linkTarget } = snack;
|
const { message, linkText, linkTarget } = snack;
|
||||||
|
|
||||||
if (this.hideTimeout === null) {
|
if (this.hideTimeout === null) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doChannelSubscribe, doChannelUnsubscribe } from 'redux/actions/subscriptions';
|
import { doChannelSubscribe, doChannelUnsubscribe } from 'redux/actions/subscriptions';
|
||||||
import { doOpenModal } from 'redux/actions/app';
|
import { doNotify } from 'lbry-redux';
|
||||||
import { selectSubscriptions } from 'redux/selectors/subscriptions';
|
import { selectSubscriptions } from 'redux/selectors/subscriptions';
|
||||||
import SubscribeButton from './view';
|
import SubscribeButton from './view';
|
||||||
|
|
||||||
|
@ -11,5 +11,5 @@ const select = (state, props) => ({
|
||||||
export default connect(select, {
|
export default connect(select, {
|
||||||
doChannelSubscribe,
|
doChannelSubscribe,
|
||||||
doChannelUnsubscribe,
|
doChannelUnsubscribe,
|
||||||
doOpenModal,
|
doNotify,
|
||||||
})(SubscribeButton);
|
})(SubscribeButton);
|
||||||
|
|
|
@ -16,7 +16,7 @@ type Props = {
|
||||||
subscriptions: Array<Subscription>,
|
subscriptions: Array<Subscription>,
|
||||||
doChannelSubscribe: ({ channelName: string, uri: string }) => void,
|
doChannelSubscribe: ({ channelName: string, uri: string }) => void,
|
||||||
doChannelUnsubscribe: SubscribtionArgs => void,
|
doChannelUnsubscribe: SubscribtionArgs => void,
|
||||||
doOpenModal: string => void,
|
doNotify: ({ id: string }) => void,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default (props: Props) => {
|
export default (props: Props) => {
|
||||||
|
@ -26,7 +26,7 @@ export default (props: Props) => {
|
||||||
subscriptions,
|
subscriptions,
|
||||||
doChannelSubscribe,
|
doChannelSubscribe,
|
||||||
doChannelUnsubscribe,
|
doChannelUnsubscribe,
|
||||||
doOpenModal,
|
doNotify,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const isSubscribed =
|
const isSubscribed =
|
||||||
|
@ -42,7 +42,7 @@ export default (props: Props) => {
|
||||||
label={subscriptionLabel}
|
label={subscriptionLabel}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (!subscriptions.length) {
|
if (!subscriptions.length) {
|
||||||
doOpenModal(modals.FIRST_SUBSCRIPTION);
|
doNotify({ id: modals.FIRST_SUBSCRIPTION });
|
||||||
}
|
}
|
||||||
subscriptionHandler({
|
subscriptionHandler({
|
||||||
channelName,
|
channelName,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { selectClaimedRewardsByTransactionId } from 'redux/selectors/rewards';
|
import { selectClaimedRewardsByTransactionId } from 'redux/selectors/rewards';
|
||||||
import { doNavigate } from 'redux/actions/navigation';
|
import { doNavigate } from 'redux/actions/navigation';
|
||||||
import { doOpenModal } from 'redux/actions/app';
|
import { doNotify } from 'lbry-redux';
|
||||||
import { selectAllMyClaimsByOutpoint } from 'lbry-redux';
|
import { selectAllMyClaimsByOutpoint } from 'lbry-redux';
|
||||||
import TransactionList from './view';
|
import TransactionList from './view';
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ const select = state => ({
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
navigate: (path, params) => dispatch(doNavigate(path, params)),
|
navigate: (path, params) => dispatch(doNavigate(path, params)),
|
||||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
openModal: (modal, props) => dispatch(doNotify(modal, props)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(select, perform)(TransactionList);
|
export default connect(select, perform)(TransactionList);
|
||||||
|
|
|
@ -23,7 +23,7 @@ type Props = {
|
||||||
slim?: boolean,
|
slim?: boolean,
|
||||||
transactions: Array<Transaction>,
|
transactions: Array<Transaction>,
|
||||||
rewards: {},
|
rewards: {},
|
||||||
openModal: (string, any) => void,
|
openModal: ({ id: string }, { nout: number, txid: string }) => void,
|
||||||
myClaims: any,
|
myClaims: any,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ class TransactionList extends React.PureComponent<Props, State> {
|
||||||
}
|
}
|
||||||
|
|
||||||
revokeClaim(txid: string, nout: number) {
|
revokeClaim(txid: string, nout: number) {
|
||||||
this.props.openModal(modals.CONFIRM_CLAIM_REVOKE, { txid, nout });
|
this.props.openModal({ id: modals.CONFIRM_CLAIM_REVOKE }, { txid, nout });
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {
|
||||||
} from 'redux/selectors/user';
|
} from 'redux/selectors/user';
|
||||||
import UserVerify from './view';
|
import UserVerify from './view';
|
||||||
import { selectCurrentModal } from 'redux/selectors/app';
|
import { selectCurrentModal } from 'redux/selectors/app';
|
||||||
import { doOpenModal } from 'redux/actions/app';
|
import { doNotify } from 'lbry-redux';
|
||||||
import { PHONE_COLLECTION } from 'constants/modal_types';
|
import { PHONE_COLLECTION } from 'constants/modal_types';
|
||||||
|
|
||||||
const select = (state, props) => {
|
const select = (state, props) => {
|
||||||
|
@ -26,7 +26,7 @@ const select = (state, props) => {
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
navigate: uri => dispatch(doNavigate(uri)),
|
navigate: uri => dispatch(doNavigate(uri)),
|
||||||
verifyUserIdentity: token => dispatch(doUserIdentityVerify(token)),
|
verifyUserIdentity: token => dispatch(doUserIdentityVerify(token)),
|
||||||
verifyPhone: () => dispatch(doOpenModal(PHONE_COLLECTION)),
|
verifyPhone: () => dispatch(doNotify({ id: PHONE_COLLECTION })),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(select, perform)(UserVerify);
|
export default connect(select, perform)(UserVerify);
|
||||||
|
|
|
@ -13,7 +13,12 @@ type Props = {
|
||||||
|
|
||||||
class WalletAddress extends React.PureComponent<Props> {
|
class WalletAddress extends React.PureComponent<Props> {
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
this.props.checkAddressIsMine(this.props.receiveAddress);
|
const { checkAddressIsMine, receiveAddress, getNewAddress } = this.props;
|
||||||
|
if (!receiveAddress) {
|
||||||
|
getNewAddress();
|
||||||
|
} else {
|
||||||
|
checkAddressIsMine(receiveAddress);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -5,9 +5,9 @@ import {
|
||||||
selectSearchState as selectSearch,
|
selectSearchState as selectSearch,
|
||||||
selectWunderBarAddress,
|
selectWunderBarAddress,
|
||||||
doUpdateSearchQuery,
|
doUpdateSearchQuery,
|
||||||
|
doNotify,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { doNavigate } from 'redux/actions/navigation';
|
import { doNavigate } from 'redux/actions/navigation';
|
||||||
import { doOpenModal } from 'redux/actions/app';
|
|
||||||
import Wunderbar from './view';
|
import Wunderbar from './view';
|
||||||
|
|
||||||
const select = state => {
|
const select = state => {
|
||||||
|
@ -27,7 +27,7 @@ const select = state => {
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
onSearch: query => {
|
onSearch: query => {
|
||||||
dispatch(doUpdateSearchQuery(query));
|
dispatch(doUpdateSearchQuery(query));
|
||||||
dispatch(doOpenModal(MODALS.SEARCH));
|
dispatch(doNotify({ id: MODALS.SEARCH }));
|
||||||
},
|
},
|
||||||
onSubmit: (uri, extraParams) => dispatch(doNavigate('/show', { uri, ...extraParams })),
|
onSubmit: (uri, extraParams) => dispatch(doNavigate('/show', { uri, ...extraParams })),
|
||||||
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
|
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
export const OPEN_MODAL = 'OPEN_MODAL';
|
|
||||||
export const CLOSE_MODAL = 'CLOSE_MODAL';
|
|
||||||
export const SHOW_SNACKBAR = 'SHOW_SNACKBAR';
|
|
||||||
export const REMOVE_SNACKBAR_SNACK = 'REMOVE_SNACKBAR_SNACK';
|
|
||||||
export const WINDOW_FOCUSED = 'WINDOW_FOCUSED';
|
export const WINDOW_FOCUSED = 'WINDOW_FOCUSED';
|
||||||
export const DAEMON_READY = 'DAEMON_READY';
|
export const DAEMON_READY = 'DAEMON_READY';
|
||||||
export const DAEMON_VERSION_MATCH = 'DAEMON_VERSION_MATCH';
|
export const DAEMON_VERSION_MATCH = 'DAEMON_VERSION_MATCH';
|
||||||
|
|
|
@ -10,9 +10,9 @@ import { Provider } from 'react-redux';
|
||||||
import {
|
import {
|
||||||
doConditionalAuthNavigate,
|
doConditionalAuthNavigate,
|
||||||
doDaemonReady,
|
doDaemonReady,
|
||||||
doShowSnackBar,
|
|
||||||
doAutoUpdate,
|
doAutoUpdate,
|
||||||
} from 'redux/actions/app';
|
} from 'redux/actions/app';
|
||||||
|
import { doNotify } from 'lbry-redux';
|
||||||
import { doNavigate } from 'redux/actions/navigation';
|
import { doNavigate } from 'redux/actions/navigation';
|
||||||
import { doDownloadLanguages, doUpdateIsNightAsync } from 'redux/actions/settings';
|
import { doDownloadLanguages, doUpdateIsNightAsync } from 'redux/actions/settings';
|
||||||
import { doUserEmailVerify } from 'redux/actions/user';
|
import { doUserEmailVerify } from 'redux/actions/user';
|
||||||
|
@ -38,7 +38,10 @@ ipcRenderer.on('open-uri-requested', (event, uri, newSession) => {
|
||||||
app.store.dispatch(doConditionalAuthNavigate(newSession));
|
app.store.dispatch(doConditionalAuthNavigate(newSession));
|
||||||
app.store.dispatch(doUserEmailVerify(verification.token, verification.recaptcha));
|
app.store.dispatch(doUserEmailVerify(verification.token, verification.recaptcha));
|
||||||
} else {
|
} else {
|
||||||
app.store.dispatch(doShowSnackBar({ message: 'Invalid Verification URI' }));
|
app.store.dispatch(doNotify({
|
||||||
|
message: 'Invalid Verification URI',
|
||||||
|
displayType: ['snackbar']
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
app.store.dispatch(doNavigate('/show', { uri }));
|
app.store.dispatch(doNavigate('/show', { uri }));
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doLoadVideo, doSetPlayingUri } from 'redux/actions/content';
|
import { doLoadVideo, doSetPlayingUri } from 'redux/actions/content';
|
||||||
import { doCloseModal, makeSelectMetadataForUri } from 'lbry-redux';
|
import { doHideNotification, makeSelectMetadataForUri } from 'lbry-redux';
|
||||||
import ModalAffirmPurchase from './view';
|
import ModalAffirmPurchase from './view';
|
||||||
|
|
||||||
const select = (state, props) => ({
|
const select = (state, props) => ({
|
||||||
|
@ -10,9 +10,9 @@ const select = (state, props) => ({
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
cancelPurchase: () => {
|
cancelPurchase: () => {
|
||||||
dispatch(doSetPlayingUri(null));
|
dispatch(doSetPlayingUri(null));
|
||||||
dispatch(doCloseModal());
|
dispatch(doHideNotification());
|
||||||
},
|
},
|
||||||
closeModal: () => dispatch(doCloseModal()),
|
closeModal: () => dispatch(doHideNotification()),
|
||||||
loadVideo: uri => dispatch(doLoadVideo(uri)),
|
loadVideo: uri => dispatch(doLoadVideo(uri)),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doCloseModal } from 'lbry-redux';
|
import { doHideNotification } from 'lbry-redux';
|
||||||
import ModalAuthFailure from './view';
|
import ModalAuthFailure from './view';
|
||||||
|
|
||||||
const select = state => ({});
|
const select = state => ({});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
close: () => dispatch(doCloseModal()),
|
close: () => dispatch(doHideNotification()),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(null, null)(ModalAuthFailure);
|
export default connect(null, null)(ModalAuthFailure);
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doCloseModal, doAutoUpdateDeclined } from 'redux/actions/app';
|
import { doAutoUpdateDeclined } from 'redux/actions/app';
|
||||||
|
import { doHideNotification } from 'lbry-redux';
|
||||||
import ModalAutoUpdateConfirm from './view';
|
import ModalAutoUpdateConfirm from './view';
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
closeModal: () => dispatch(doCloseModal()),
|
closeModal: () => dispatch(doHideNotification()),
|
||||||
declineAutoUpdate: () => dispatch(doAutoUpdateDeclined()),
|
declineAutoUpdate: () => dispatch(doAutoUpdateDeclined()),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doCloseModal, doAutoUpdateDeclined } from 'redux/actions/app';
|
import { doAutoUpdateDeclined } from 'redux/actions/app';
|
||||||
|
import { doHideNotification } from 'lbry-redux';
|
||||||
import ModalAutoUpdateDownloaded from './view';
|
import ModalAutoUpdateDownloaded from './view';
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
closeModal: () => dispatch(doCloseModal()),
|
closeModal: () => dispatch(doHideNotification()),
|
||||||
declineAutoUpdate: () => dispatch(doAutoUpdateDeclined()),
|
declineAutoUpdate: () => dispatch(doAutoUpdateDeclined()),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { connect } from 'react-redux';
|
||||||
import { doNavigate } from 'redux/actions/navigation';
|
import { doNavigate } from 'redux/actions/navigation';
|
||||||
import { doSetClientSetting } from 'redux/actions/settings';
|
import { doSetClientSetting } from 'redux/actions/settings';
|
||||||
import { selectUserIsRewardApproved } from 'redux/selectors/user';
|
import { selectUserIsRewardApproved } from 'redux/selectors/user';
|
||||||
import { selectBalance, doCloseModal } from 'lbry-redux';
|
import { selectBalance, doHideNotification } from 'lbry-redux';
|
||||||
import { selectUnclaimedRewardValue } from 'redux/selectors/rewards';
|
import { selectUnclaimedRewardValue } from 'redux/selectors/rewards';
|
||||||
import * as settings from 'constants/settings';
|
import * as settings from 'constants/settings';
|
||||||
import ModalCreditIntro from './view';
|
import ModalCreditIntro from './view';
|
||||||
|
@ -17,11 +17,11 @@ const perform = dispatch => () => ({
|
||||||
addBalance: () => {
|
addBalance: () => {
|
||||||
dispatch(doSetClientSetting(settings.CREDIT_REQUIRED_ACKNOWLEDGED, true));
|
dispatch(doSetClientSetting(settings.CREDIT_REQUIRED_ACKNOWLEDGED, true));
|
||||||
dispatch(doNavigate('/getcredits'));
|
dispatch(doNavigate('/getcredits'));
|
||||||
dispatch(doCloseModal());
|
dispatch(doHideNotification());
|
||||||
},
|
},
|
||||||
closeModal: () => {
|
closeModal: () => {
|
||||||
dispatch(doSetClientSetting(settings.CREDIT_REQUIRED_ACKNOWLEDGED, true));
|
dispatch(doSetClientSetting(settings.CREDIT_REQUIRED_ACKNOWLEDGED, true));
|
||||||
dispatch(doCloseModal());
|
dispatch(doHideNotification());
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as settings from 'constants/settings';
|
import * as settings from 'constants/settings';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doCloseModal } from 'redux/actions/app';
|
import { doHideNotification } from 'lbry-redux';
|
||||||
import { doSetClientSetting } from 'redux/actions/settings';
|
import { doSetClientSetting } from 'redux/actions/settings';
|
||||||
import { selectEmailToVerify, selectUser } from 'redux/selectors/user';
|
import { selectEmailToVerify, selectUser } from 'redux/selectors/user';
|
||||||
import ModalEmailCollection from './view';
|
import ModalEmailCollection from './view';
|
||||||
|
@ -13,7 +13,7 @@ const select = state => ({
|
||||||
const perform = dispatch => () => ({
|
const perform = dispatch => () => ({
|
||||||
closeModal: () => {
|
closeModal: () => {
|
||||||
dispatch(doSetClientSetting(settings.EMAIL_COLLECTION_ACKNOWLEDGED, true));
|
dispatch(doSetClientSetting(settings.EMAIL_COLLECTION_ACKNOWLEDGED, true));
|
||||||
dispatch(doCloseModal());
|
dispatch(doHideNotification());
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doCloseModal } from 'lbry-redux';
|
import { doHideNotification } from 'lbry-redux';
|
||||||
import ModalError from './view';
|
import ModalError from './view';
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
closeModal: () => dispatch(doCloseModal()),
|
closeModal: () => dispatch(doHideNotification()),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(null, perform)(ModalError);
|
export default connect(null, perform)(ModalError);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doCloseModal, makeSelectMetadataForUri } from 'lbry-redux';
|
import { doHideNotification, makeSelectMetadataForUri } from 'lbry-redux';
|
||||||
import ModalFileTimeout from './view';
|
import ModalFileTimeout from './view';
|
||||||
|
|
||||||
const select = (state, props) => ({
|
const select = (state, props) => ({
|
||||||
|
@ -7,7 +7,7 @@ const select = (state, props) => ({
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
closeModal: () => dispatch(doCloseModal()),
|
closeModal: () => dispatch(doHideNotification()),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(select, perform)(ModalFileTimeout);
|
export default connect(select, perform)(ModalFileTimeout);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import rewards from 'rewards';
|
import rewards from 'rewards';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doCloseModal } from 'lbry-redux';
|
import { doHideNotification } from 'lbry-redux';
|
||||||
import { makeSelectRewardByType } from 'redux/selectors/rewards';
|
import { makeSelectRewardByType } from 'redux/selectors/rewards';
|
||||||
import ModalFirstReward from './view';
|
import ModalFirstReward from './view';
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ const select = state => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
closeModal: () => dispatch(doCloseModal()),
|
closeModal: () => dispatch(doHideNotification()),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(select, perform)(ModalFirstReward);
|
export default connect(select, perform)(ModalFirstReward);
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doCloseModal } from 'redux/actions/app';
|
import { doHideNotification } from 'lbry-redux';
|
||||||
import { doNavigate } from 'redux/actions/navigation';
|
import { doNavigate } from 'redux/actions/navigation';
|
||||||
import ModalFirstSubscription from './view';
|
import ModalFirstSubscription from './view';
|
||||||
|
|
||||||
const perform = dispatch => () => ({
|
const perform = dispatch => () => ({
|
||||||
closeModal: () => dispatch(doCloseModal()),
|
closeModal: () => dispatch(doHideNotification()),
|
||||||
navigate: path => dispatch(doNavigate(path)),
|
navigate: path => dispatch(doNavigate(path)),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import * as settings from 'constants/settings';
|
import * as settings from 'constants/settings';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doCloseModal } from 'redux/actions/app';
|
import { doHideNotification } from 'lbry-redux';
|
||||||
import { doSetClientSetting } from 'redux/actions/settings';
|
import { doSetClientSetting } from 'redux/actions/settings';
|
||||||
import { selectPhoneToVerify, selectUser } from 'redux/selectors/user';
|
import { selectPhoneToVerify, selectUser } from 'redux/selectors/user';
|
||||||
import { doNavigate } from 'redux/actions/navigation';
|
import { doNavigate } from 'redux/actions/navigation';
|
||||||
|
@ -14,7 +14,7 @@ const select = state => ({
|
||||||
|
|
||||||
const perform = dispatch => () => ({
|
const perform = dispatch => () => ({
|
||||||
closeModal: () => {
|
closeModal: () => {
|
||||||
dispatch(doCloseModal());
|
dispatch(doHideNotification());
|
||||||
dispatch(doNavigate('/rewards'));
|
dispatch(doNavigate('/rewards'));
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doCloseModal } from 'redux/actions/app';
|
import { doHideNotification } from 'lbry-redux';
|
||||||
import ModalSendTip from './view';
|
import ModalSendTip from './view';
|
||||||
import { doClearPublish } from 'redux/actions/publish';
|
import { doClearPublish } from 'redux/actions/publish';
|
||||||
import { doNavigate } from 'redux/actions/navigation';
|
import { doNavigate } from 'redux/actions/navigation';
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
closeModal: () => dispatch(doCloseModal()),
|
closeModal: () => dispatch(doHideNotification()),
|
||||||
clearPublish: () => dispatch(doClearPublish()),
|
clearPublish: () => dispatch(doClearPublish()),
|
||||||
navigate: (path, params) => dispatch(doNavigate(path, params)),
|
navigate: (path, params) => dispatch(doNavigate(path, params)),
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doDeleteFileAndGoBack } from 'redux/actions/file';
|
import { doDeleteFileAndGoBack } from 'redux/actions/file';
|
||||||
import {
|
import {
|
||||||
doCloseModal,
|
doHideNotification,
|
||||||
makeSelectTitleForUri,
|
makeSelectTitleForUri,
|
||||||
makeSelectClaimIsMine,
|
makeSelectClaimIsMine,
|
||||||
makeSelectFileInfoForUri,
|
makeSelectFileInfoForUri,
|
||||||
|
@ -15,7 +15,7 @@ const select = (state, props) => ({
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
closeModal: () => dispatch(doCloseModal()),
|
closeModal: () => dispatch(doHideNotification()),
|
||||||
deleteFile: (fileInfo, deleteFromComputer, abandonClaim) => {
|
deleteFile: (fileInfo, deleteFromComputer, abandonClaim) => {
|
||||||
dispatch(doDeleteFileAndGoBack(fileInfo, deleteFromComputer, abandonClaim));
|
dispatch(doDeleteFileAndGoBack(fileInfo, deleteFromComputer, abandonClaim));
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doCloseModal, doAbandonClaim, selectTransactionItems } from 'lbry-redux';
|
import { doHideNotification, doAbandonClaim, selectTransactionItems } from 'lbry-redux';
|
||||||
import ModalRevokeClaim from './view';
|
import ModalRevokeClaim from './view';
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
|
@ -7,7 +7,7 @@ const select = state => ({
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
closeModal: () => dispatch(doCloseModal()),
|
closeModal: () => dispatch(doHideNotification()),
|
||||||
abandonClaim: (txid, nout) => dispatch(doAbandonClaim(txid, nout)),
|
abandonClaim: (txid, nout) => dispatch(doAbandonClaim(txid, nout)),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doCloseModal } from 'lbry-redux';
|
import { doHideNotification } from 'lbry-redux';
|
||||||
import { doAuthNavigate } from 'redux/actions/navigation';
|
import { doAuthNavigate } from 'redux/actions/navigation';
|
||||||
import ModalRewardApprovalRequired from './view';
|
import ModalRewardApprovalRequired from './view';
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
doAuth: () => {
|
doAuth: () => {
|
||||||
dispatch(doCloseModal());
|
dispatch(doHideNotification());
|
||||||
dispatch(doAuthNavigate());
|
dispatch(doAuthNavigate());
|
||||||
},
|
},
|
||||||
closeModal: () => dispatch(doCloseModal()),
|
closeModal: () => dispatch(doHideNotification()),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(null, perform)(ModalRewardApprovalRequired);
|
export default connect(null, perform)(ModalRewardApprovalRequired);
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import * as settings from 'constants/settings';
|
import * as settings from 'constants/settings';
|
||||||
import { selectCurrentModal, selectModalProps, selectModalsAllowed } from 'redux/selectors/app';
|
import { selectCurrentModal, selectModalProps, selectModalsAllowed } from 'redux/selectors/app';
|
||||||
import { doOpenModal } from 'redux/actions/app';
|
import {
|
||||||
import { selectCostForCurrentPageUri, selectBalance, selectCurrentPage } from 'lbry-redux';
|
doNotify,
|
||||||
|
selectCostForCurrentPageUri,
|
||||||
|
selectBalance,
|
||||||
|
selectCurrentPage,
|
||||||
|
selectNotification,
|
||||||
|
selectNotificationProps,
|
||||||
|
} from 'lbry-redux';
|
||||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||||
import { selectUser, selectUserIsVerificationCandidate } from 'redux/selectors/user';
|
import { selectUser, selectUserIsVerificationCandidate } from 'redux/selectors/user';
|
||||||
|
|
||||||
|
@ -22,10 +28,12 @@ const select = state => ({
|
||||||
isWelcomeAcknowledged: makeSelectClientSetting(settings.NEW_USER_ACKNOWLEDGED)(state),
|
isWelcomeAcknowledged: makeSelectClientSetting(settings.NEW_USER_ACKNOWLEDGED)(state),
|
||||||
user: selectUser(state),
|
user: selectUser(state),
|
||||||
modalsAllowed: selectModalsAllowed(state),
|
modalsAllowed: selectModalsAllowed(state),
|
||||||
|
notification: selectNotification(state),
|
||||||
|
notificationProps: selectNotificationProps(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
openModal: modal => dispatch(doOpenModal(modal)),
|
openModal: notification => dispatch(doNotify(notification)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(select, perform)(ModalRouter);
|
export default connect(select, perform)(ModalRouter);
|
||||||
|
|
|
@ -57,7 +57,7 @@ class ModalRouter extends React.PureComponent {
|
||||||
transitionModal &&
|
transitionModal &&
|
||||||
(transitionModal != this.state.lastTransitionModal || page != this.state.lastTransitionPage)
|
(transitionModal != this.state.lastTransitionModal || page != this.state.lastTransitionPage)
|
||||||
) {
|
) {
|
||||||
openModal(transitionModal);
|
openModal({ id: transitionModal });
|
||||||
this.setState({
|
this.setState({
|
||||||
lastTransitionModal: transitionModal,
|
lastTransitionModal: transitionModal,
|
||||||
lastTransitionPage: page,
|
lastTransitionPage: page,
|
||||||
|
@ -102,51 +102,54 @@ class ModalRouter extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { modal, modalsAllowed, modalProps } = this.props;
|
const { notification, notificationProps } = this.props;
|
||||||
|
|
||||||
switch (modal) {
|
if (!notification) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
switch (notification.id) {
|
||||||
case modals.UPGRADE:
|
case modals.UPGRADE:
|
||||||
return <ModalUpgrade {...modalProps} />;
|
return <ModalUpgrade {...notificationProps} />;
|
||||||
case modals.DOWNLOADING:
|
case modals.DOWNLOADING:
|
||||||
return <ModalDownloading {...modalProps} />;
|
return <ModalDownloading {...notificationProps} />;
|
||||||
case modals.AUTO_UPDATE_DOWNLOADED:
|
case modals.AUTO_UPDATE_DOWNLOADED:
|
||||||
return <ModalAutoUpdateDownloaded {...modalProps} />;
|
return <ModalAutoUpdateDownloaded {...notificationProps} />;
|
||||||
case modals.AUTO_UPDATE_CONFIRM:
|
case modals.AUTO_UPDATE_CONFIRM:
|
||||||
return <ModalAutoUpdateConfirm {...modalProps} />;
|
return <ModalAutoUpdateConfirm {...notificationProps} />;
|
||||||
case modals.ERROR:
|
case modals.ERROR:
|
||||||
return <ModalError {...modalProps} />;
|
return <ModalError {...notificationProps} />;
|
||||||
case modals.FILE_TIMEOUT:
|
case modals.FILE_TIMEOUT:
|
||||||
return <ModalFileTimeout {...modalProps} />;
|
return <ModalFileTimeout {...notificationProps} />;
|
||||||
case modals.INSUFFICIENT_CREDITS:
|
case modals.INSUFFICIENT_CREDITS:
|
||||||
return <ModalCreditIntro {...modalProps} />;
|
return <ModalCreditIntro {...notificationProps} />;
|
||||||
case modals.WELCOME:
|
case modals.WELCOME:
|
||||||
return <ModalWelcome {...modalProps} />;
|
return <ModalWelcome {...notificationProps} />;
|
||||||
case modals.FIRST_REWARD:
|
case modals.FIRST_REWARD:
|
||||||
return <ModalFirstReward {...modalProps} />;
|
return <ModalFirstReward {...notificationProps} />;
|
||||||
case modals.AUTHENTICATION_FAILURE:
|
case modals.AUTHENTICATION_FAILURE:
|
||||||
return <ModalAuthFailure {...modalProps} />;
|
return <ModalAuthFailure {...notificationProps} />;
|
||||||
case modals.TRANSACTION_FAILED:
|
case modals.TRANSACTION_FAILED:
|
||||||
return <ModalTransactionFailed {...modalProps} />;
|
return <ModalTransactionFailed {...notificationProps} />;
|
||||||
case modals.REWARD_APPROVAL_REQUIRED:
|
case modals.REWARD_APPROVAL_REQUIRED:
|
||||||
return <ModalRewardApprovalRequired {...modalProps} />;
|
return <ModalRewardApprovalRequired {...notificationProps} />;
|
||||||
case modals.CONFIRM_FILE_REMOVE:
|
case modals.CONFIRM_FILE_REMOVE:
|
||||||
return <ModalRemoveFile {...modalProps} />;
|
return <ModalRemoveFile {...notificationProps} />;
|
||||||
case modals.AFFIRM_PURCHASE:
|
case modals.AFFIRM_PURCHASE:
|
||||||
return <ModalAffirmPurchase {...modalProps} />;
|
return <ModalAffirmPurchase {...notificationProps} />;
|
||||||
case modals.CONFIRM_CLAIM_REVOKE:
|
case modals.CONFIRM_CLAIM_REVOKE:
|
||||||
return <ModalRevokeClaim {...modalProps} />;
|
return <ModalRevokeClaim {...notificationProps} />;
|
||||||
case modals.PHONE_COLLECTION:
|
case modals.PHONE_COLLECTION:
|
||||||
return <ModalPhoneCollection {...modalProps} />;
|
return <ModalPhoneCollection {...notificationProps} />;
|
||||||
case modals.EMAIL_COLLECTION:
|
case modals.EMAIL_COLLECTION:
|
||||||
return <ModalEmailCollection {...modalProps} />;
|
return <ModalEmailCollection {...notificationProps} />;
|
||||||
case modals.FIRST_SUBSCRIPTION:
|
case modals.FIRST_SUBSCRIPTION:
|
||||||
return <ModalFirstSubscription {...modalProps} />;
|
return <ModalFirstSubscription {...notificationProps} />;
|
||||||
case modals.SEND_TIP:
|
case modals.SEND_TIP:
|
||||||
return <ModalSendTip {...modalProps} />;
|
return <ModalSendTip {...notificationProps} />;
|
||||||
case modals.PUBLISH:
|
case modals.PUBLISH:
|
||||||
return <ModalPublish {...modalProps} />;
|
return <ModalPublish {...notificationProps} />;
|
||||||
case modals.SEARCH:
|
case modals.SEARCH:
|
||||||
return <ModalSearch {...modalProps} />;
|
return <ModalSearch {...notificationProps} />;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doCloseModal } from 'redux/actions/app';
|
import { doHideNotification } from 'lbry-redux';
|
||||||
import ModalSearch from './view';
|
import ModalSearch from './view';
|
||||||
import { doClearPublish } from 'redux/actions/publish';
|
import { doClearPublish } from 'redux/actions/publish';
|
||||||
import { doNavigate } from 'redux/actions/navigation';
|
import { doNavigate } from 'redux/actions/navigation';
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
closeModal: () => dispatch(doCloseModal()),
|
closeModal: () => dispatch(doHideNotification()),
|
||||||
clearPublish: () => dispatch(doClearPublish()),
|
clearPublish: () => dispatch(doClearPublish()),
|
||||||
navigate: (path, params) => dispatch(doNavigate(path, params)),
|
navigate: (path, params) => dispatch(doNavigate(path, params)),
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doCloseModal } from 'redux/actions/app';
|
import { doHideNotification } from 'lbry-redux';
|
||||||
import ModalSendTip from './view';
|
import ModalSendTip from './view';
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
closeModal: () => dispatch(doCloseModal()),
|
closeModal: () => dispatch(doHideNotification()),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(null, perform)(ModalSendTip);
|
export default connect(null, perform)(ModalSendTip);
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doCloseModal } from 'lbry-redux';
|
import { doHideNotification } from 'lbry-redux';
|
||||||
import ModalTransactionFailed from './view';
|
import ModalTransactionFailed from './view';
|
||||||
|
|
||||||
const select = state => ({});
|
const select = state => ({});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
closeModal: () => dispatch(doCloseModal()),
|
closeModal: () => dispatch(doHideNotification()),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(select, perform)(ModalTransactionFailed);
|
export default connect(select, perform)(ModalTransactionFailed);
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import * as settings from 'constants/settings';
|
import * as settings from 'constants/settings';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doCloseModal } from 'lbry-redux';
|
import { doHideNotification } from 'lbry-redux';
|
||||||
import { doSetClientSetting } from 'redux/actions/settings';
|
import { doSetClientSetting } from 'redux/actions/settings';
|
||||||
import ModalWelcome from './view';
|
import ModalWelcome from './view';
|
||||||
|
|
||||||
const perform = dispatch => () => ({
|
const perform = dispatch => () => ({
|
||||||
closeModal: () => {
|
closeModal: () => {
|
||||||
dispatch(doSetClientSetting(settings.NEW_USER_ACKNOWLEDGED, true));
|
dispatch(doSetClientSetting(settings.NEW_USER_ACKNOWLEDGED, true));
|
||||||
dispatch(doCloseModal());
|
dispatch(doHideNotification());
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,10 @@ import {
|
||||||
makeSelectFetchingChannelClaims,
|
makeSelectFetchingChannelClaims,
|
||||||
makeSelectCurrentParam,
|
makeSelectCurrentParam,
|
||||||
selectCurrentParams,
|
selectCurrentParams,
|
||||||
|
doNotify,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { doNavigate } from 'redux/actions/navigation';
|
import { doNavigate } from 'redux/actions/navigation';
|
||||||
import { makeSelectTotalPagesForChannel } from 'redux/selectors/content';
|
import { makeSelectTotalPagesForChannel } from 'redux/selectors/content';
|
||||||
import { doOpenModal } from 'redux/actions/app';
|
|
||||||
import ChannelPage from './view';
|
import ChannelPage from './view';
|
||||||
|
|
||||||
const select = (state, props) => ({
|
const select = (state, props) => ({
|
||||||
|
@ -25,7 +25,7 @@ const perform = dispatch => ({
|
||||||
fetchClaims: (uri, page) => dispatch(doFetchClaimsByChannel(uri, page)),
|
fetchClaims: (uri, page) => dispatch(doFetchClaimsByChannel(uri, page)),
|
||||||
fetchClaimCount: uri => dispatch(doFetchClaimCountByChannel(uri)),
|
fetchClaimCount: uri => dispatch(doFetchClaimCountByChannel(uri)),
|
||||||
navigate: (path, params) => dispatch(doNavigate(path, params)),
|
navigate: (path, params) => dispatch(doNavigate(path, params)),
|
||||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
openModal: (modal, props) => dispatch(doNotify(modal, props)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(select, perform)(ChannelPage);
|
export default connect(select, perform)(ChannelPage);
|
||||||
|
|
|
@ -11,11 +11,11 @@ import {
|
||||||
makeSelectClaimForUri,
|
makeSelectClaimForUri,
|
||||||
makeSelectContentTypeForUri,
|
makeSelectContentTypeForUri,
|
||||||
makeSelectMetadataForUri,
|
makeSelectMetadataForUri,
|
||||||
|
doNotify,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { selectShowNsfw } from 'redux/selectors/settings';
|
import { selectShowNsfw } from 'redux/selectors/settings';
|
||||||
import { selectSubscriptions } from 'redux/selectors/subscriptions';
|
import { selectSubscriptions } from 'redux/selectors/subscriptions';
|
||||||
import { selectMediaPaused } from 'redux/selectors/media';
|
import { selectMediaPaused } from 'redux/selectors/media';
|
||||||
import { doOpenModal } from 'redux/actions/app';
|
|
||||||
import { doPrepareEdit } from 'redux/actions/publish';
|
import { doPrepareEdit } from 'redux/actions/publish';
|
||||||
import FilePage from './view';
|
import FilePage from './view';
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ const perform = dispatch => ({
|
||||||
fetchFileInfo: uri => dispatch(doFetchFileInfo(uri)),
|
fetchFileInfo: uri => dispatch(doFetchFileInfo(uri)),
|
||||||
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
|
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
|
||||||
checkSubscription: subscription => dispatch(doCheckSubscription(subscription)),
|
checkSubscription: subscription => dispatch(doCheckSubscription(subscription)),
|
||||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
openModal: (modal, props) => dispatch(doNotify(modal, props)),
|
||||||
prepareEdit: (publishData, uri) => dispatch(doPrepareEdit(publishData, uri)),
|
prepareEdit: (publishData, uri) => dispatch(doPrepareEdit(publishData, uri)),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ type Props = {
|
||||||
claimIsMine: boolean,
|
claimIsMine: boolean,
|
||||||
costInfo: ?{},
|
costInfo: ?{},
|
||||||
navigate: (string, ?{}) => void,
|
navigate: (string, ?{}) => void,
|
||||||
openModal: (string, any) => void,
|
openModal: ({ id: string }, { uri: string }) => void,
|
||||||
fetchFileInfo: string => void,
|
fetchFileInfo: string => void,
|
||||||
fetchCostInfo: string => void,
|
fetchCostInfo: string => void,
|
||||||
prepareEdit: ({}) => void,
|
prepareEdit: ({}) => void,
|
||||||
|
@ -171,7 +171,7 @@ class FilePage extends React.Component<Props> {
|
||||||
button="alt"
|
button="alt"
|
||||||
iconRight="Send"
|
iconRight="Send"
|
||||||
label={__('Enjoy this? Send a tip')}
|
label={__('Enjoy this? Send a tip')}
|
||||||
onClick={() => openModal(modals.SEND_TIP, { uri })}
|
onClick={() => openModal({ id: modals.SEND_TIP }, { uri })}
|
||||||
/>
|
/>
|
||||||
<SubscribeButton uri={subscriptionUri} channelName={channelName} />
|
<SubscribeButton uri={subscriptionUri} channelName={channelName} />
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import { FormRow } from 'component/common/form';
|
import { FormRow } from 'component/common/form';
|
||||||
import { Lbry } from 'lbry-redux';
|
import { Lbry, doNotify } from 'lbry-redux';
|
||||||
import { doShowSnackBar } from 'redux/actions/app';
|
|
||||||
|
|
||||||
class ReportPage extends React.Component {
|
class ReportPage extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
@ -32,7 +31,8 @@ class ReportPage extends React.Component {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Display global notice
|
// Display global notice
|
||||||
const action = doShowSnackBar({
|
const action = doNotify({
|
||||||
|
displayType: ['snackbar'],
|
||||||
message: __('Message received! Thanks for helping.'),
|
message: __('Message received! Thanks for helping.'),
|
||||||
isError: false,
|
isError: false,
|
||||||
});
|
});
|
||||||
|
|
|
@ -29,22 +29,6 @@ const Fs = remote.require('fs');
|
||||||
|
|
||||||
const CHECK_UPGRADE_INTERVAL = 10 * 60 * 1000;
|
const CHECK_UPGRADE_INTERVAL = 10 * 60 * 1000;
|
||||||
|
|
||||||
export function doOpenModal(modal, modalProps = {}) {
|
|
||||||
return {
|
|
||||||
type: ACTIONS.OPEN_MODAL,
|
|
||||||
data: {
|
|
||||||
modal,
|
|
||||||
modalProps,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function doCloseModal() {
|
|
||||||
return {
|
|
||||||
type: ACTIONS.CLOSE_MODAL,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function doUpdateDownloadProgress(percent) {
|
export function doUpdateDownloadProgress(percent) {
|
||||||
return {
|
return {
|
||||||
type: ACTIONS.UPGRADE_DOWNLOAD_PROGRESSED,
|
type: ACTIONS.UPGRADE_DOWNLOAD_PROGRESSED,
|
||||||
|
@ -100,7 +84,7 @@ export function doDownloadUpgrade() {
|
||||||
type: ACTIONS.UPGRADE_DOWNLOAD_STARTED,
|
type: ACTIONS.UPGRADE_DOWNLOAD_STARTED,
|
||||||
});
|
});
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.OPEN_MODAL,
|
type: ACTIONS.CREATE_NOTIFICATION,
|
||||||
data: {
|
data: {
|
||||||
modal: MODALS.DOWNLOADING,
|
modal: MODALS.DOWNLOADING,
|
||||||
},
|
},
|
||||||
|
@ -127,14 +111,14 @@ export function doDownloadUpgradeRequested() {
|
||||||
if (autoUpdateDeclined) {
|
if (autoUpdateDeclined) {
|
||||||
// The user declined an update before, so show the "confirm" dialog
|
// The user declined an update before, so show the "confirm" dialog
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.OPEN_MODAL,
|
type: ACTIONS.CREATE_NOTIFICATION,
|
||||||
data: { modal: MODALS.AUTO_UPDATE_CONFIRM },
|
data: { modal: MODALS.AUTO_UPDATE_CONFIRM },
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// The user was never shown the original update dialog (e.g. because they were
|
// The user was never shown the original update dialog (e.g. because they were
|
||||||
// watching a video). So show the inital "update downloaded" dialog.
|
// watching a video). So show the inital "update downloaded" dialog.
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.OPEN_MODAL,
|
type: ACTIONS.CREATE_NOTIFICATION,
|
||||||
data: { modal: MODALS.AUTO_UPDATE_DOWNLOADED },
|
data: { modal: MODALS.AUTO_UPDATE_DOWNLOADED },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -152,7 +136,7 @@ export function doAutoUpdate() {
|
||||||
});
|
});
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.OPEN_MODAL,
|
type: ACTIONS.CREATE_NOTIFICATION,
|
||||||
data: { modal: MODALS.AUTO_UPDATE_DOWNLOADED },
|
data: { modal: MODALS.AUTO_UPDATE_DOWNLOADED },
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -223,7 +207,7 @@ export function doCheckUpgradeAvailable() {
|
||||||
(!selectIsUpgradeSkipped(state) || remoteVersion !== selectRemoteVersion(state))
|
(!selectIsUpgradeSkipped(state) || remoteVersion !== selectRemoteVersion(state))
|
||||||
) {
|
) {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.OPEN_MODAL,
|
type: ACTIONS.CREATE_NOTIFICATION,
|
||||||
data: {
|
data: {
|
||||||
modal: MODALS.UPGRADE,
|
modal: MODALS.UPGRADE,
|
||||||
},
|
},
|
||||||
|
@ -273,7 +257,7 @@ export function doCheckDaemonVersion() {
|
||||||
export function doAlertError(errorList) {
|
export function doAlertError(errorList) {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.OPEN_MODAL,
|
type: ACTIONS.CREATE_NOTIFICATION,
|
||||||
data: {
|
data: {
|
||||||
modal: MODALS.ERROR,
|
modal: MODALS.ERROR,
|
||||||
modalProps: { error: errorList },
|
modalProps: { error: errorList },
|
||||||
|
@ -300,12 +284,6 @@ export function doDaemonReady() {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function doRemoveSnackBarSnack() {
|
|
||||||
return {
|
|
||||||
type: ACTIONS.REMOVE_SNACKBAR_SNACK,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function doClearCache() {
|
export function doClearCache() {
|
||||||
return () => {
|
return () => {
|
||||||
window.cacheStore.purge();
|
window.cacheStore.purge();
|
||||||
|
|
|
@ -2,7 +2,8 @@ import * as MODALS from 'constants/modal_types';
|
||||||
import * as NOTIFICATION_TYPES from 'constants/notification_types';
|
import * as NOTIFICATION_TYPES from 'constants/notification_types';
|
||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
import Lbryio from 'lbryio';
|
import Lbryio from 'lbryio';
|
||||||
import { doAlertError, doOpenModal } from 'redux/actions/app';
|
import { doNotify } from 'lbry-redux';
|
||||||
|
import { doAlertError } from 'redux/actions/app';
|
||||||
import { doClaimEligiblePurchaseRewards } from 'redux/actions/rewards';
|
import { doClaimEligiblePurchaseRewards } from 'redux/actions/rewards';
|
||||||
import { doNavigate } from 'redux/actions/navigation';
|
import { doNavigate } from 'redux/actions/navigation';
|
||||||
import {
|
import {
|
||||||
|
@ -259,7 +260,7 @@ export function doLoadVideo(uri) {
|
||||||
data: { uri },
|
data: { uri },
|
||||||
});
|
});
|
||||||
|
|
||||||
dispatch(doOpenModal(MODALS.FILE_TIMEOUT, { uri }));
|
dispatch(doNotify({ id: MODALS.FILE_TIMEOUT }, { uri }));
|
||||||
} else {
|
} else {
|
||||||
dispatch(doDownloadFile(uri, streamInfo));
|
dispatch(doDownloadFile(uri, streamInfo));
|
||||||
}
|
}
|
||||||
|
@ -289,7 +290,7 @@ export function doPurchaseUri(uri, specificCostInfo) {
|
||||||
|
|
||||||
function attemptPlay(cost, instantPurchaseMax = null) {
|
function attemptPlay(cost, instantPurchaseMax = null) {
|
||||||
if (cost > 0 && (!instantPurchaseMax || cost > instantPurchaseMax)) {
|
if (cost > 0 && (!instantPurchaseMax || cost > instantPurchaseMax)) {
|
||||||
dispatch(doOpenModal(MODALS.AFFIRM_PURCHASE, { uri }));
|
dispatch(doNotify({ id: MODALS.AFFIRM_PURCHASE }, { uri }));
|
||||||
} else {
|
} else {
|
||||||
dispatch(doLoadVideo(uri));
|
dispatch(doLoadVideo(uri));
|
||||||
}
|
}
|
||||||
|
@ -317,7 +318,7 @@ export function doPurchaseUri(uri, specificCostInfo) {
|
||||||
|
|
||||||
if (cost > balance) {
|
if (cost > balance) {
|
||||||
dispatch(doSetPlayingUri(null));
|
dispatch(doSetPlayingUri(null));
|
||||||
dispatch(doOpenModal(MODALS.INSUFFICIENT_CREDITS));
|
dispatch(doNotify({ id: MODALS.INSUFFICIENT_CREDITS }));
|
||||||
Promise.resolve();
|
Promise.resolve();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,8 +7,8 @@ import {
|
||||||
selectMyClaimsOutpoints,
|
selectMyClaimsOutpoints,
|
||||||
selectFileInfosByOutpoint,
|
selectFileInfosByOutpoint,
|
||||||
selectTotalDownloadProgress,
|
selectTotalDownloadProgress,
|
||||||
|
doHideNotification,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { doCloseModal } from 'redux/actions/app';
|
|
||||||
import { doHistoryBack } from 'redux/actions/navigation';
|
import { doHistoryBack } from 'redux/actions/navigation';
|
||||||
import setProgressBar from 'util/setProgressBar';
|
import setProgressBar from 'util/setProgressBar';
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ export function doDeleteFile(outpoint, deleteFromComputer, abandonClaim) {
|
||||||
export function doDeleteFileAndGoBack(fileInfo, deleteFromComputer, abandonClaim) {
|
export function doDeleteFileAndGoBack(fileInfo, deleteFromComputer, abandonClaim) {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
const actions = [];
|
const actions = [];
|
||||||
actions.push(doCloseModal());
|
actions.push(doHideNotification());
|
||||||
actions.push(doHistoryBack());
|
actions.push(doHistoryBack());
|
||||||
actions.push(doDeleteFile(fileInfo, deleteFromComputer, abandonClaim));
|
actions.push(doDeleteFile(fileInfo, deleteFromComputer, abandonClaim));
|
||||||
dispatch(batchActions(...actions));
|
dispatch(batchActions(...actions));
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
// @flow
|
// @flow
|
||||||
import * as MODALS from 'constants/modal_types';
|
import * as MODALS from 'constants/modal_types';
|
||||||
import { ACTIONS, Lbry, selectMyClaimsWithoutChannels } from 'lbry-redux';
|
import { ACTIONS, Lbry, selectMyClaimsWithoutChannels, doNotify } from 'lbry-redux';
|
||||||
import { selectPendingPublishes } from 'redux/selectors/publish';
|
import { selectPendingPublishes } from 'redux/selectors/publish';
|
||||||
import { doOpenModal } from 'redux/actions/app';
|
|
||||||
import type {
|
import type {
|
||||||
UpdatePublishFormData,
|
UpdatePublishFormData,
|
||||||
UpdatePublishFormAction,
|
UpdatePublishFormAction,
|
||||||
|
@ -27,7 +26,14 @@ export const doUpdatePublishForm = (publishFormValue: UpdatePublishFormData) =>
|
||||||
});
|
});
|
||||||
|
|
||||||
export const doPrepareEdit = (claim: any, uri: string) => (dispatch: Dispatch) => {
|
export const doPrepareEdit = (claim: any, uri: string) => (dispatch: Dispatch) => {
|
||||||
const { name, amount, channel_name: channelName, value: { stream: { metadata } } } = claim;
|
const {
|
||||||
|
name,
|
||||||
|
amount,
|
||||||
|
channel_name: channelName,
|
||||||
|
value: {
|
||||||
|
stream: { metadata },
|
||||||
|
},
|
||||||
|
} = claim;
|
||||||
const {
|
const {
|
||||||
author,
|
author,
|
||||||
description,
|
description,
|
||||||
|
@ -139,12 +145,12 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat
|
||||||
type: ACTIONS.PUBLISH_SUCCESS,
|
type: ACTIONS.PUBLISH_SUCCESS,
|
||||||
data: { pendingPublish: { ...publishPayload, isEdit } },
|
data: { pendingPublish: { ...publishPayload, isEdit } },
|
||||||
});
|
});
|
||||||
dispatch(doOpenModal(MODALS.PUBLISH, { uri }));
|
dispatch(doNotify({ id: MODALS.PUBLISH }, { uri }));
|
||||||
};
|
};
|
||||||
|
|
||||||
const failure = error => {
|
const failure = error => {
|
||||||
dispatch({ type: ACTIONS.PUBLISH_FAIL });
|
dispatch({ type: ACTIONS.PUBLISH_FAIL });
|
||||||
dispatch(doOpenModal(MODALS.ERROR, { error: error.message }));
|
dispatch(doNotify({ id: MODALS.ERROR }, { error: error.message }));
|
||||||
};
|
};
|
||||||
|
|
||||||
return Lbry.publish(publishPayload).then(success, failure);
|
return Lbry.publish(publishPayload).then(success, failure);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import * as ACTIONS from 'constants/action_types';
|
import * as ACTIONS from 'constants/action_types';
|
||||||
import * as MODALS from 'constants/modal_types';
|
import * as MODALS from 'constants/modal_types';
|
||||||
import Lbryio from 'lbryio';
|
import Lbryio from 'lbryio';
|
||||||
import { doOpenModal, doShowSnackBar } from 'redux/actions/app';
|
import { doNotify } from 'lbry-redux';
|
||||||
import { doClaimRewardType, doRewardList } from 'redux/actions/rewards';
|
import { doClaimRewardType, doRewardList } from 'redux/actions/rewards';
|
||||||
import {
|
import {
|
||||||
selectEmailToVerify,
|
selectEmailToVerify,
|
||||||
|
@ -52,7 +52,7 @@ export function doAuthenticate() {
|
||||||
dispatch(doFetchInviteStatus());
|
dispatch(doFetchInviteStatus());
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
dispatch(doOpenModal(MODALS.AUTHENTICATION_FAILURE));
|
dispatch(doNotify({ id: MODALS.AUTHENTICATION_FAILURE }));
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.AUTHENTICATION_FAILURE,
|
type: ACTIONS.AUTHENTICATION_FAILURE,
|
||||||
data: { error },
|
data: { error },
|
||||||
|
@ -292,7 +292,8 @@ export function doUserInviteNew(email) {
|
||||||
});
|
});
|
||||||
|
|
||||||
dispatch(
|
dispatch(
|
||||||
doShowSnackBar({
|
doNotify({
|
||||||
|
displayType: ['snackbar'],
|
||||||
message: __('Invite sent to %s', email),
|
message: __('Invite sent to %s', email),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
@ -155,59 +155,11 @@ reducers[ACTIONS.CHECK_UPGRADE_SUBSCRIBE] = (state, action) =>
|
||||||
checkUpgradeTimer: action.data.checkUpgradeTimer,
|
checkUpgradeTimer: action.data.checkUpgradeTimer,
|
||||||
});
|
});
|
||||||
|
|
||||||
reducers[ACTIONS.OPEN_MODAL] = (state, action) => {
|
|
||||||
if (!state.modalsAllowed) {
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
return Object.assign({}, state, {
|
|
||||||
modal: action.data.modal,
|
|
||||||
modalProps: action.data.modalProps || {},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
reducers[ACTIONS.CLOSE_MODAL] = state =>
|
|
||||||
Object.assign({}, state, {
|
|
||||||
modal: undefined,
|
|
||||||
modalProps: {},
|
|
||||||
});
|
|
||||||
|
|
||||||
reducers[ACTIONS.UPGRADE_DOWNLOAD_PROGRESSED] = (state, action) =>
|
reducers[ACTIONS.UPGRADE_DOWNLOAD_PROGRESSED] = (state, action) =>
|
||||||
Object.assign({}, state, {
|
Object.assign({}, state, {
|
||||||
downloadProgress: action.data.percent,
|
downloadProgress: action.data.percent,
|
||||||
});
|
});
|
||||||
|
|
||||||
reducers[ACTIONS.SHOW_SNACKBAR] = (state, action) => {
|
|
||||||
const { message, linkText, linkTarget, isError } = action.data;
|
|
||||||
const snackBar = Object.assign({}, state.snackBar);
|
|
||||||
const snacks = Object.assign([], snackBar.snacks);
|
|
||||||
snacks.push({
|
|
||||||
message,
|
|
||||||
linkText,
|
|
||||||
linkTarget,
|
|
||||||
isError,
|
|
||||||
});
|
|
||||||
const newSnackBar = Object.assign({}, snackBar, {
|
|
||||||
snacks,
|
|
||||||
});
|
|
||||||
|
|
||||||
return Object.assign({}, state, {
|
|
||||||
snackBar: newSnackBar,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
reducers[ACTIONS.REMOVE_SNACKBAR_SNACK] = state => {
|
|
||||||
const snackBar = Object.assign({}, state.snackBar);
|
|
||||||
const snacks = Object.assign([], snackBar.snacks);
|
|
||||||
snacks.shift();
|
|
||||||
|
|
||||||
const newSnackBar = Object.assign({}, snackBar, {
|
|
||||||
snacks,
|
|
||||||
});
|
|
||||||
|
|
||||||
return Object.assign({}, state, {
|
|
||||||
snackBar: newSnackBar,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
reducers[ACTIONS.DOWNLOADING_COMPLETED] = state => {
|
reducers[ACTIONS.DOWNLOADING_COMPLETED] = state => {
|
||||||
const { badgeNumber } = state;
|
const { badgeNumber } = state;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Lbry, doShowSnackBar } from 'lbry-redux';
|
import { Lbry, doNotify } from 'lbry-redux';
|
||||||
import Lbryio from 'lbryio';
|
import Lbryio from 'lbryio';
|
||||||
|
|
||||||
function rewardMessage(type, amount) {
|
function rewardMessage(type, amount) {
|
||||||
|
@ -51,7 +51,7 @@ rewards.claimReward = type => {
|
||||||
const message = rewardMessage(type, reward.reward_amount);
|
const message = rewardMessage(type, reward.reward_amount);
|
||||||
|
|
||||||
// Display global notice
|
// Display global notice
|
||||||
const action = doShowSnackBar({
|
const action = doNotify({
|
||||||
message,
|
message,
|
||||||
linkText: __('Show All'),
|
linkText: __('Show All'),
|
||||||
linkTarget: '/rewards',
|
linkTarget: '/rewards',
|
||||||
|
|
|
@ -8,6 +8,7 @@ import {
|
||||||
fileInfoReducer,
|
fileInfoReducer,
|
||||||
searchReducer,
|
searchReducer,
|
||||||
walletReducer,
|
walletReducer,
|
||||||
|
notificationsReducer,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import navigationReducer from 'redux/reducers/navigation';
|
import navigationReducer from 'redux/reducers/navigation';
|
||||||
import rewardsReducer from 'redux/reducers/rewards';
|
import rewardsReducer from 'redux/reducers/rewards';
|
||||||
|
@ -69,6 +70,7 @@ const reducers = combineReducers({
|
||||||
subscriptions: subscriptionsReducer,
|
subscriptions: subscriptionsReducer,
|
||||||
media: mediaReducer,
|
media: mediaReducer,
|
||||||
publish: publishReducer,
|
publish: publishReducer,
|
||||||
|
notifications: notificationsReducer,
|
||||||
});
|
});
|
||||||
|
|
||||||
const bulkThunk = createBulkThunkMiddleware();
|
const bulkThunk = createBulkThunkMiddleware();
|
||||||
|
|
|
@ -5588,9 +5588,8 @@ lazy-val@^1.0.3:
|
||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/lazy-val/-/lazy-val-1.0.3.tgz#bb97b200ef00801d94c317e29dc6ed39e31c5edc"
|
resolved "https://registry.yarnpkg.com/lazy-val/-/lazy-val-1.0.3.tgz#bb97b200ef00801d94c317e29dc6ed39e31c5edc"
|
||||||
|
|
||||||
lbry-redux@lbryio/lbry-redux:
|
"lbry-redux@file:../lbry-redux":
|
||||||
version "0.0.1"
|
version "0.0.1"
|
||||||
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/800083dc244191e5f2385ba8df11b85ca5fec8eb"
|
|
||||||
dependencies:
|
dependencies:
|
||||||
amplitude-js "^4.0.0"
|
amplitude-js "^4.0.0"
|
||||||
bluebird "^3.5.1"
|
bluebird "^3.5.1"
|
||||||
|
|
Loading…
Reference in a new issue