Commit 7e1794ce authored by Akinwale Ariwodola's avatar Akinwale Ariwodola
Browse files

fix publishes link. change minimum bid to 0.01.

parent 4c4d561f
Pipeline #1831 passed with stage
Subproject commit 4d1f142f9cf4f221a2110b7d7aa77b9f42731253 Subproject commit 5aa051332447a00c0b6586c31b34108f5c8c132d
...@@ -17,7 +17,7 @@ export default class ModalRepostView extends React.PureComponent { ...@@ -17,7 +17,7 @@ export default class ModalRepostView extends React.PureComponent {
state = { state = {
channelName: null, channelName: null,
creditsInputFocused: false, creditsInputFocused: false,
depositAmount: '0.1', depositAmount: '0.01',
repostName: null, repostName: null,
repostStarted: false, repostStarted: false,
showAdvanced: false, showAdvanced: false,
......
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { doSendTip, doToast, selectBalance } from 'lbry-redux'; import { doSendTip, doToast, selectBalance } from 'lbry-redux';
import { selectSdkReady } from 'redux/selectors/settings';
import ModalTipView from './view'; import ModalTipView from './view';
const select = state => ({ const select = state => ({
balance: selectBalance(state), balance: selectBalance(state),
sdkReady: selectSdkReady(state),
}); });
const perform = dispatch => ({ const perform = dispatch => ({
...@@ -12,7 +14,4 @@ const perform = dispatch => ({ ...@@ -12,7 +14,4 @@ const perform = dispatch => ({
dispatch(doSendTip(amount, claimId, isSupport, successCallback, errorCallback)), dispatch(doSendTip(amount, claimId, isSupport, successCallback, errorCallback)),
}); });
export default connect( export default connect(select, perform)(ModalTipView);
select,
perform
)(ModalTipView);
...@@ -18,9 +18,18 @@ export default class ModalTipView extends React.PureComponent { ...@@ -18,9 +18,18 @@ export default class ModalTipView extends React.PureComponent {
}; };
handleSendTip = () => { handleSendTip = () => {
const { claim, balance, notify, onSendTipFailed, onSendTipSuccessful, sendTip } = this.props; const { claim, balance, notify, onSendTipFailed, onSendTipSuccessful, sdkReady, sendTip } = this.props;
const { tipAmount } = this.state; const { tipAmount } = this.state;
if (!sdkReady) {
notify({
message: __(
'The background service is still initializing. You can still explore and watch content during the initialization process.',
),
});
return;
}
if (tipAmount > balance) { if (tipAmount > balance) {
notify({ notify({
message: 'Insufficient credits', message: 'Insufficient credits',
......
...@@ -47,7 +47,7 @@ export default class ChannelCreator extends React.PureComponent { ...@@ -47,7 +47,7 @@ export default class ChannelCreator extends React.PureComponent {
channelNameUserEdited: false, channelNameUserEdited: false,
newChannelTitle: '', newChannelTitle: '',
newChannelName: '', newChannelName: '',
newChannelBid: 0.1, newChannelBid: 0.01,
addingChannel: false, addingChannel: false,
creatingChannel: false, creatingChannel: false,
editChannelUrl: null, editChannelUrl: null,
...@@ -280,7 +280,7 @@ export default class ChannelCreator extends React.PureComponent { ...@@ -280,7 +280,7 @@ export default class ChannelCreator extends React.PureComponent {
handleCreateCancel = () => { handleCreateCancel = () => {
const { clearChannelFormState } = this.props; const { clearChannelFormState } = this.props;
clearChannelFormState(); // explicitly clear state on cancel? clearChannelFormState(); // explicitly clear state on cancel?
this.setState({ showCreateChannel: false, newChannelName: '', newChannelBid: 0.1 }); this.setState({ showCreateChannel: false, newChannelName: '', newChannelBid: 0.01 });
}; };
handlePickerValueChange = (itemValue, itemIndex) => { handlePickerValueChange = (itemValue, itemIndex) => {
...@@ -589,7 +589,7 @@ export default class ChannelCreator extends React.PureComponent { ...@@ -589,7 +589,7 @@ export default class ChannelCreator extends React.PureComponent {
channelNameUserEdited: false, channelNameUserEdited: false,
newChannelTitle: '', newChannelTitle: '',
newChannelName: '', newChannelName: '',
newChannelBid: 0.1, newChannelBid: 0.01,
addingChannel: false, addingChannel: false,
creatingChannel: false, creatingChannel: false,
newChannelNameError: '', newChannelNameError: '',
......
...@@ -820,7 +820,16 @@ class FilePage extends React.PureComponent { ...@@ -820,7 +820,16 @@ class FilePage extends React.PureComponent {
}; };
onDownloadPressed = () => { onDownloadPressed = () => {
const { claim, title } = this.props; const { claim, notify, sdkReady, title } = this.props;
if (!sdkReady) {
notify({
message: __(
'The background service is still initializing. You can still explore and watch content during the initialization process.',
),
});
return;
}
const fileSize = claim && claim.value && claim.value.source ? claim.value.source.size : 0; const fileSize = claim && claim.value && claim.value.source ? claim.value.source.size : 0;
Alert.alert( Alert.alert(
__('Download file'), __('Download file'),
...@@ -1020,7 +1029,6 @@ class FilePage extends React.PureComponent { ...@@ -1020,7 +1029,6 @@ class FilePage extends React.PureComponent {
myClaimUris, myClaimUris,
navigation, navigation,
position, position,
purchaseUri,
pushDrawerStack, pushDrawerStack,
setPlayerVisible, setPlayerVisible,
thumbnail, thumbnail,
......
...@@ -121,7 +121,7 @@ class PublishPage extends React.PureComponent { ...@@ -121,7 +121,7 @@ class PublishPage extends React.PureComponent {
// input data // input data
hasEditedContentAddress: false, hasEditedContentAddress: false,
bid: 0.1, bid: 0.01,
description: null, description: null,
title: null, title: null,
language: 'en', language: 'en',
......
...@@ -194,7 +194,7 @@ class PublishesPage extends React.PureComponent { ...@@ -194,7 +194,7 @@ class PublishesPage extends React.PureComponent {
}); });
} else { } else {
// TODO: when shortUrl is available for my claims, navigate to that URL instead // TODO: when shortUrl is available for my claims, navigate to that URL instead
navigateToUri(navigation, item); navigateToUri(navigation, claim.permanent_url);
} }
} }
}} }}
......
...@@ -12,6 +12,7 @@ import { ...@@ -12,6 +12,7 @@ import {
selectViewMode, selectViewMode,
selectFirstRunCompleted, selectFirstRunCompleted,
selectShowSuggestedSubs, selectShowSuggestedSubs,
selectUser,
} from 'lbryinc'; } from 'lbryinc';
import { doToast, selectFetchingClaimSearch } from 'lbry-redux'; import { doToast, selectFetchingClaimSearch } from 'lbry-redux';
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer'; import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
...@@ -35,6 +36,7 @@ const select = state => ({ ...@@ -35,6 +36,7 @@ const select = state => ({
showSuggestedSubs: selectShowSuggestedSubs(state), showSuggestedSubs: selectShowSuggestedSubs(state),
timeItem: selectTimeItem(state), timeItem: selectTimeItem(state),
sdkReady: selectSdkReady(state), sdkReady: selectSdkReady(state),
user: selectUser(state),
}); });
const perform = dispatch => ({ const perform = dispatch => ({
......
...@@ -38,6 +38,7 @@ class SubscriptionsPage extends React.PureComponent { ...@@ -38,6 +38,7 @@ class SubscriptionsPage extends React.PureComponent {
showSortPicker: false, showSortPicker: false,
showTimePicker: false, showTimePicker: false,
showModalSuggestedSubs: false, showModalSuggestedSubs: false,
userEmailVerified: false,
orderBy: ['release_time'], orderBy: ['release_time'],
filteredChannels: [], filteredChannels: [],
currentSortByItem: Constants.CLAIM_SEARCH_SORT_BY_ITEMS[1], // should always default to sorting subscriptions by new currentSortByItem: Constants.CLAIM_SEARCH_SORT_BY_ITEMS[1], // should always default to sorting subscriptions by new
...@@ -57,21 +58,14 @@ class SubscriptionsPage extends React.PureComponent { ...@@ -57,21 +58,14 @@ class SubscriptionsPage extends React.PureComponent {
} }
onComponentFocused = () => { onComponentFocused = () => {
const { const { currentRoute, doFetchMySubscriptions, pushDrawerStack, setPlayerVisible, user } = this.props;
currentRoute,
doFetchMySubscriptions,
doFetchRecommendedSubscriptions,
doSetViewMode,
pushDrawerStack,
setPlayerVisible,
subscriptionsViewMode,
} = this.props;
if (currentRoute === Constants.DRAWER_ROUTE_SUBSCRIPTIONS) { if (currentRoute === Constants.DRAWER_ROUTE_SUBSCRIPTIONS) {
pushDrawerStack(); pushDrawerStack();
} }
setPlayerVisible(); setPlayerVisible();
NativeModules.Firebase.setCurrentScreen('Subscriptions'); NativeModules.Firebase.setCurrentScreen('Subscriptions');
this.setState({ userEmailVerified: user && user.has_verified_email });
doFetchMySubscriptions(); doFetchMySubscriptions();
}; };
...@@ -81,12 +75,19 @@ class SubscriptionsPage extends React.PureComponent { ...@@ -81,12 +75,19 @@ class SubscriptionsPage extends React.PureComponent {
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
const { currentRoute } = nextProps; const { currentRoute, user } = nextProps;
const { currentRoute: prevRoute } = this.props; const { currentRoute: prevRoute, doFetchMySubscriptions } = this.props;
if (Constants.DRAWER_ROUTE_SUBSCRIPTIONS === currentRoute && currentRoute !== prevRoute) { if (Constants.DRAWER_ROUTE_SUBSCRIPTIONS === currentRoute && currentRoute !== prevRoute) {
this.onComponentFocused(); this.onComponentFocused();
} }
if (user && user.has_verified_email && !this.state.userEmailVerified) {
// user just signed in
this.setState({ showingSuggestedSubs: false, userEmailVerified: true }, () => {
doFetchMySubscriptions();
});
}
this.unsubscribeShortChannelUrls(); this.unsubscribeShortChannelUrls();
} }
......
...@@ -445,8 +445,8 @@ const publishStyle = StyleSheet.create({ ...@@ -445,8 +445,8 @@ const publishStyle = StyleSheet.create({
}, },
publishesFooter: { publishesFooter: {
marginTop: 2, marginTop: 2,
marginLeft: 8, marginLeft: 16,
marginRight: 8, marginRight: 16,
}, },
publishesFooterButton: { publishesFooterButton: {
alignSelf: 'flex-start', alignSelf: 'flex-start',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment