Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe5462971e |
No files matched your search
+1
-1
@@ -129,7 +129,7 @@ const Constants = {
|
||||
{ name: TIME_ALL, label: 'All time' },
|
||||
],
|
||||
|
||||
DEFAULT_ORDER_BY: ['trending_group', 'trending_mixed'],
|
||||
DEFAULT_ORDER_BY: ['trending_global', 'trending_mixed'],
|
||||
|
||||
ORDER_BY_EFFECTIVE_AMOUNT: 'effective_amount',
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class ChannelPage extends React.PureComponent {
|
||||
autoStyle: null,
|
||||
showSortPicker: false,
|
||||
showTimePicker: false,
|
||||
orderBy: ['release_time'], // sort by new by default
|
||||
orderBy: Constants.DEFAULT_ORDER_BY,
|
||||
activeTab: Constants.CONTENT_TAB,
|
||||
};
|
||||
|
||||
@@ -48,9 +48,8 @@ class ChannelPage extends React.PureComponent {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { fetchChannelListMine, setSortByItem } = this.props;
|
||||
const { fetchChannelListMine } = this.props;
|
||||
NativeModules.Firebase.setCurrentScreen('Channel');
|
||||
setSortByItem(Constants.CLAIM_SEARCH_SORT_BY_ITEMS[1]); // sort by newest first
|
||||
fetchChannelListMine();
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ class FilePage extends React.PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
attemptAutoGet: false,
|
||||
autoPlayMedia: false,
|
||||
autoDownloadStarted: false,
|
||||
downloadButtonShown: false,
|
||||
@@ -189,10 +190,12 @@ class FilePage extends React.PureComponent {
|
||||
const {
|
||||
claim,
|
||||
contentType,
|
||||
costInfo,
|
||||
fileInfo,
|
||||
isResolvingUri,
|
||||
resolveUri,
|
||||
navigation,
|
||||
purchaseUri,
|
||||
searchRecommended,
|
||||
title,
|
||||
} = this.props;
|
||||
@@ -214,6 +217,21 @@ class FilePage extends React.PureComponent {
|
||||
uri: this.state.uri,
|
||||
};
|
||||
}
|
||||
|
||||
// attempt to retrieve images and html/text automatically once the claim is loaded, and it's free
|
||||
const mediaType = Lbry.getMediaType(contentType);
|
||||
const isViewable = mediaType === 'image' || mediaType === 'text';
|
||||
if (claim && costInfo && costInfo.cost === 0 && !this.state.autoGetAttempted && isViewable) {
|
||||
this.setState(
|
||||
{
|
||||
autoGetAttempted: true,
|
||||
downloadPressed: true,
|
||||
autoPlayMedia: true,
|
||||
stopDownloadConfirmed: false,
|
||||
},
|
||||
() => purchaseUri(claim.permanent_url, costInfo, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fetchFileInfo(props) {
|
||||
|
||||
Reference in new issue
Block a user