Fix for generating a wallet address on load
This commit is contained in:
parent
da9d29ed6a
commit
763dd6197e
3 changed files with 7 additions and 7 deletions
|
@ -10,6 +10,9 @@ import {AuthOverlay} from './component/auth.js';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import store from 'store.js';
|
import store from 'store.js';
|
||||||
import { runTriggers } from 'triggers'
|
import { runTriggers } from 'triggers'
|
||||||
|
import {
|
||||||
|
doDaemonReady
|
||||||
|
} from 'actions/app'
|
||||||
|
|
||||||
const {remote} = require('electron');
|
const {remote} = require('electron');
|
||||||
const contextMenu = remote.require('./menu/context-menu');
|
const contextMenu = remote.require('./menu/context-menu');
|
||||||
|
@ -37,7 +40,7 @@ var init = function() {
|
||||||
})
|
})
|
||||||
|
|
||||||
function onDaemonReady() {
|
function onDaemonReady() {
|
||||||
window.sessionStorage.setItem('loaded', 'y'); //once we've made it here once per session, we don't need to show splash again
|
app.store.dispatch(doDaemonReady())
|
||||||
ReactDOM.render(<Provider store={store}><div>{ lbryio.enabled ? <AuthOverlay/> : '' }<App /><SnackBar /></div></Provider>, canvas)
|
ReactDOM.render(<Provider store={store}><div>{ lbryio.enabled ? <AuthOverlay/> : '' }<App /><SnackBar /></div></Provider>, canvas)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ reducers[types.UPGRADE_DOWNLOAD_PROGRESSED] = function(state, action) {
|
||||||
}
|
}
|
||||||
|
|
||||||
reducers[types.DAEMON_READY] = function(state, action) {
|
reducers[types.DAEMON_READY] = function(state, action) {
|
||||||
// sessionStorage.setItem('loaded', 'y');
|
window.sessionStorage.setItem('loaded', 'y')
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
daemonReady: true
|
daemonReady: true
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { createSelector } from 'reselect'
|
import { createSelector } from 'reselect'
|
||||||
import {
|
import {
|
||||||
selectCurrentPage,
|
selectCurrentPage,
|
||||||
|
selectDaemonReady,
|
||||||
} from 'selectors/app'
|
} from 'selectors/app'
|
||||||
|
|
||||||
export const _selectState = state => state.wallet || {}
|
export const _selectState = state => state.wallet || {}
|
||||||
|
@ -77,10 +78,6 @@ export const selectGettingNewAddress = createSelector(
|
||||||
(state) => state.gettingNewAddress
|
(state) => state.gettingNewAddress
|
||||||
)
|
)
|
||||||
|
|
||||||
export const selectDaemonReady = createSelector(
|
|
||||||
() => sessionStorage.getItem('loaded') == 'y'
|
|
||||||
)
|
|
||||||
|
|
||||||
export const shouldGetReceiveAddress = createSelector(
|
export const shouldGetReceiveAddress = createSelector(
|
||||||
selectReceiveAddress,
|
selectReceiveAddress,
|
||||||
selectGettingNewAddress,
|
selectGettingNewAddress,
|
||||||
|
@ -88,7 +85,7 @@ export const shouldGetReceiveAddress = createSelector(
|
||||||
(address, fetching, daemonReady) => {
|
(address, fetching, daemonReady) => {
|
||||||
if (!daemonReady) return false
|
if (!daemonReady) return false
|
||||||
if (fetching) return false
|
if (fetching) return false
|
||||||
if (address !== undefined) return false
|
if (address) return false
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue