diff --git a/ui/js/actions/content.js b/ui/js/actions/content.js
index 43fbfab9b..74f0f3f74 100644
--- a/ui/js/actions/content.js
+++ b/ui/js/actions/content.js
@@ -10,6 +10,9 @@ import {
selectFileInfoForUri,
selectDownloadingByUri,
} from 'selectors/file_info'
+import {
+ selectResolvingUris
+} from 'selectors/content'
import {
selectCostInfoForUri,
} from 'selectors/cost_info'
@@ -22,26 +25,38 @@ import {
export function doResolveUri(uri) {
return function(dispatch, getState) {
- dispatch({
- type: types.RESOLVE_URI_STARTED,
- data: { uri }
- })
- lbry.resolve({ uri }).then((resolutionInfo) => {
- const {
- claim,
- certificate,
- } = resolutionInfo ? resolutionInfo : { claim : null, certificate: null }
+ const state = getState()
+ const alreadyResolving = selectResolvingUris(state).indexOf(uri) !== -1
+ if (!alreadyResolving) {
dispatch({
- type: types.RESOLVE_URI_COMPLETED,
- data: {
- uri,
+ type: types.RESOLVE_URI_STARTED,
+ data: { uri }
+ })
+
+ lbry.resolve({ uri }).then((resolutionInfo) => {
+ const {
claim,
certificate,
- }
+ } = resolutionInfo ? resolutionInfo : { claim : null, certificate: null }
+
+ dispatch({
+ type: types.RESOLVE_URI_COMPLETED,
+ data: {
+ uri,
+ claim,
+ certificate,
+ }
+ })
})
- })
+ }
+ }
+}
+
+export function doCancelResolveUri(uri) {
+ return function(dispatch, getState) {
+ lbry.cancelResolve({ uri })
}
}
diff --git a/ui/js/actions/file_info.js b/ui/js/actions/file_info.js
index 87f962471..f7d2b08f3 100644
--- a/ui/js/actions/file_info.js
+++ b/ui/js/actions/file_info.js
@@ -21,13 +21,6 @@ export function doFetchFileInfo(uri) {
const outpoint = claim ? `${claim.txid}:${claim.nout}` : null
const alreadyFetching = !!selectLoadingByUri(state)[uri]
- if (!outpoint) {
- console.log(claim);
- console.log(outpoint);
- console.log(selectClaimsByUri(state))
- throw new Error("Unable to get outpoint from claim for URI " + uri);
- }
-
if (!alreadyFetching) {
dispatch({
type: types.FETCH_FILE_INFO_STARTED,
diff --git a/ui/js/component/app/index.js b/ui/js/component/app/index.js
index a7ce7ce70..dcb94bd0f 100644
--- a/ui/js/component/app/index.js
+++ b/ui/js/component/app/index.js
@@ -7,6 +7,9 @@ import {
import {
doCheckUpgradeAvailable,
} from 'actions/app'
+import {
+ doUpdateBalance,
+} from 'actions/wallet'
import App from './view'
const select = (state) => ({
@@ -15,6 +18,7 @@ const select = (state) => ({
const perform = (dispatch) => ({
checkUpgradeAvailable: () => dispatch(doCheckUpgradeAvailable()),
+ updateBalance: (balance) => dispatch(doUpdateBalance(balance))
})
export default connect(select, perform)(App)
diff --git a/ui/js/component/app/view.jsx b/ui/js/component/app/view.jsx
index 5e47c81f7..1c7ff4eb4 100644
--- a/ui/js/component/app/view.jsx
+++ b/ui/js/component/app/view.jsx
@@ -4,7 +4,8 @@ import Header from 'component/header';
import ErrorModal from 'component/errorModal'
import DownloadingModal from 'component/downloadingModal'
import UpgradeModal from 'component/upgradeModal'
-import {Line} from 'rc-progress';
+import lbry from 'lbry'
+import {Line} from 'rc-progress'
class App extends React.Component {
componentWillMount() {
@@ -15,6 +16,10 @@ class App extends React.Component {
if (!this.props.upgradeSkipped) {
this.props.checkUpgradeAvailable()
}
+
+ lbry.balanceSubscribe((balance) => {
+ this.props.updateBalance(balance)
+ })
}
render() {
diff --git a/ui/js/component/fileActions/index.js b/ui/js/component/fileActions/index.js
index 87b4cb330..c238f36b8 100644
--- a/ui/js/component/fileActions/index.js
+++ b/ui/js/component/fileActions/index.js
@@ -3,7 +3,6 @@ import {
connect,
} from 'react-redux'
import {
- selectHasSignature,
selectPlatform,
} from 'selectors/app'
import {
diff --git a/ui/js/component/fileActions/view.jsx b/ui/js/component/fileActions/view.jsx
index 468e89329..ec2b93587 100644
--- a/ui/js/component/fileActions/view.jsx
+++ b/ui/js/component/fileActions/view.jsx
@@ -72,11 +72,14 @@ class FileActions extends React.Component {
let content
- if (fileInfo === undefined || isAvailable === undefined) {
+ console.log('file actions render')
+ console.log(this.props)
+
+ if (!fileInfo && isAvailable === undefined) {
content =