+ );
+ }
+}
+
+export let SubHeader = React.createClass({
render: function() {
- var links = [],
+ let links = [],
viewingUrl = '?' + this.props.viewingPage;
for (let link of Object.keys(this.props.links)) {
@@ -81,7 +203,7 @@ var SubHeader = React.createClass({
);
}
return (
-
);
diff --git a/ui/js/lbry.js b/ui/js/lbry.js
index e2807090a..4c0d511d4 100644
--- a/ui/js/lbry.js
+++ b/ui/js/lbry.js
@@ -31,7 +31,6 @@ function savePendingPublish({name, channel_name}) {
return newPendingPublish;
}
-
/**
* If there is a pending publish with the given name or outpoint, remove it.
* A channel name may also be provided along with name.
@@ -132,6 +131,21 @@ lbry.connect = function() {
return lbry._connectPromise;
}
+
+//kill this but still better than document.title =, which this replaced
+lbry.setTitle = function(title) {
+ document.title = title + " - LBRY";
+}
+
+//kill this with proper routing
+lbry.back = function() {
+ if (window.history.length > 1) {
+ window.history.back();
+ } else {
+ window.location.href = "?discover";
+ }
+}
+
lbry.isDaemonAcceptingConnections = function (callback) {
// Returns true/false whether the daemon is at a point it will start returning status
lbry.call('status', {}, () => callback(true), null, () => callback(false))
@@ -633,7 +647,7 @@ lbry.resolve = function(params={}) {
if (!params.uri) {
throw "Resolve has hacked cache on top of it that requires a URI"
}
- if (params.uri && claimCache[params.uri]) {
+ if (params.uri && claimCache[params.uri] !== undefined) {
resolve(claimCache[params.uri]);
} else {
lbry.call('resolve', params, function(data) {
diff --git a/ui/js/lbryio.js b/ui/js/lbryio.js
index bbe6b9ccd..20934bbbb 100644
--- a/ui/js/lbryio.js
+++ b/ui/js/lbryio.js
@@ -7,7 +7,7 @@ const lbryio = {
_accessToken: getLocal('accessToken'),
_authenticationPromise: null,
_user : null,
- enabled: true
+ enabled: false
};
const CONNECTION_STRING = process.env.LBRY_APP_API_URL ? process.env.LBRY_APP_API_URL : 'https://api.lbry.io/';
@@ -150,20 +150,6 @@ lbryio.authenticate = function() {
} else {
setCurrentUser()
}
- // if (!lbryio._
- //(data) => {
- // resolve(data)
- // localStorage.setItem('accessToken', ID);
- // localStorage.setItem('appId', installation_id);
- // this.setState({
- // registrationCheckComplete: true,
- // justRegistered: true,
- // });
- //});
- // lbryio.call('user_install', 'exists', {app_id: installation_id}).then((userExists) => {
- // // TODO: deal with case where user exists already with the same app ID, but we have no access token.
- // // Possibly merge in to the existing user with the same app ID.
- // })
}).catch(reject);
});
}
diff --git a/ui/js/page/discover.js b/ui/js/page/discover.js
index 42ed3999d..d522a99f8 100644
--- a/ui/js/page/discover.js
+++ b/ui/js/page/discover.js
@@ -1,79 +1,18 @@
import React from 'react';
-import lbry from '../lbry.js';
import lbryio from '../lbryio.js';
-import lbryuri from '../lbryuri.js';
-import lighthouse from '../lighthouse.js';
import {FileTile, FileTileStream} from '../component/file-tile.js';
-import {Link} from '../component/link.js';
import {ToolTip} from '../component/tooltip.js';
-import {BusyMessage} from '../component/common.js';
-
-var fetchResultsStyle = {
- color: '#888',
- textAlign: 'center',
- fontSize: '1.2em'
- };
-
-var SearchActive = React.createClass({
- render: function() {
- return (
-
-
-
- );
- }
-});
-
-var searchNoResultsStyle = {
- textAlign: 'center'
-}, searchNoResultsMessageStyle = {
- fontStyle: 'italic',
- marginRight: '5px'
-};
-
-var SearchNoResults = React.createClass({
- render: function() {
- return (
-
- No one has checked anything in for {this.props.query} yet.
-
-
- );
- }
-});
-
-var SearchResults = React.createClass({
- render: function() {
- var rows = [],
- seenNames = {}; //fix this when the search API returns claim IDs
-
- for (let {name, claim, claim_id, channel_name, channel_id, txid, nout} of this.props.results) {
- const uri = lbryuri.build({
- channelName: channel_name,
- contentName: name,
- claimId: channel_id || claim_id,
- });
-
- rows.push(
-
- );
- }
- return (
-
{rows}
- );
- }
-});
const communityCategoryToolTipText = ('Community Content is a public space where anyone can share content with the ' +
-'rest of the LBRY community. Bid on the names "one," "two," "three," "four" and ' +
+ 'rest of the LBRY community. Bid on the names "one," "two," "three," "four" and ' +
'"five" to put your content here!');
-var FeaturedCategory = React.createClass({
+let FeaturedCategory = React.createClass({
render: function() {
return (