Merge remote-tracking branch 'origin/master' into redux

This commit is contained in:
Jeremy Kauffman 2017-05-09 16:58:48 -04:00
commit 60d298b354
10 changed files with 94 additions and 21 deletions

View file

@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.10.0rc9
current_version = 0.10.0
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)((?P<release>[a-z]+)(?P<candidate>\d+))?

View file

@ -23,16 +23,52 @@ Web UI version numbers should always match the corresponding version of LBRY App
* Enable windows code signing of binary
### Changed
* Update process now easier and more reliable
* Updated search to be compatible with new Lighthouse servers
* Cleaned up shutdown logic
* Support lbry v0.10 API signatures
*
*
### Fixed
* Fix Watch page and progress bars for new API changes
* Error modals now display full screen properly
*
### Deprecated
*
*
### Removed
*
*
## [0.10.0] - 2017-05-04
### Added
* The UI has been overhauled to use an omnibar and drop the sidebar.
* The app is much more responsive switching pages. It no longer reloads the entire page and all assets on each page change.
* lbry.js now offers a subscription model for wallet balance similar to file info.
* Fixed file info subscribes not being unsubscribed in unmount.
* Fixed drawer not highlighting selected page.
* You can now make API calls directly on the lbry module, e.g. lbry.peer_list()
* New-style API calls return promises instead of using callbacks
* Wherever possible, use outpoints for unique IDs instead of names or SD hashes
* New publishes now display immediately in My Files, even before they hit the lbrynet file manager.
* New welcome flow for new users
* Redesigned UI for Discover
* Handle more of price calculations at the daemon layer to improve page load time
* Add special support for building channel claims in lbryuri module
* Enable windows code signing of binary
### Changed
* Update process now easier and more reliable
* Updated search to be compatible with new Lighthouse servers
* Cleaned up shutdown logic
* Support lbry v0.10 API signatures
### Fixed
* Fix Watch page and progress bars for new API changes
## [0.9.0rc15] - 2017-03-09
### Added
* A way to access the Developer Settings panel in Electron (Ctrl-Shift and click logo)

View file

@ -33,6 +33,10 @@ let daemonStopRequested = false;
// this is set to true and app.quit() is called again to quit for real.
let readyToQuit = false;
// If we receive a URI to open from an external app but there's no window to
// send it to, it's cached in this variable.
let openUri = null;
function checkForNewVersion(callback) {
function formatRc(ver) {
// Adds dash if needed to make RC suffix semver friendly
@ -55,19 +59,25 @@ function checkForNewVersion(callback) {
const [_, remoteVersion] = tagName.match(/^v([\d.]+(?:-?rc\d+)?)$/);
if (!remoteVersion) {
console.log('Malformed remote version string:', tagName);
win.webContents.send('version-info-received', null);
if (win) {
win.webContents.send('version-info-received', null);
}
} else {
console.log('Remote version:', remoteVersion);
const upgradeAvailable = semver.gt(formatRc(remoteVersion), formatRc(localVersion));
console.log(upgradeAvailable ? 'Upgrade available' : 'No upgrade available');
win.webContents.send('version-info-received', {remoteVersion, localVersion, upgradeAvailable});
if (win) {
win.webContents.send('version-info-received', {remoteVersion, localVersion, upgradeAvailable});
}
}
})
});
req.on('error', (err) => {
console.log('Failed to get current version from GitHub. Error:', err);
win.webContents.send('version-info-received', null);
if (win) {
win.webContents.send('version-info-received', null);
}
});
}
@ -113,9 +123,16 @@ function getPidsForProcessName(name) {
function createWindow () {
win = new BrowserWindow({backgroundColor: '#155B4A', minWidth: 800, minHeight: 600 }) //$color-primary
win.maximize()
win.webContents.openDevTools();
win.loadURL(`file://${__dirname}/dist/index.html`)
if (openUri) { // We stored and received a URI that an external app requested before we had a window object
win.webContents.on('did-finish-load', () => {
win.webContents.send('open-uri-requested', openUri);
});
}
win.on('closed', () => {
win = null
})
@ -306,3 +323,17 @@ function upgrade(event, installerPath) {
}
ipcMain.on('upgrade', upgrade);
if (process.platform == 'darwin') {
app.on('open-url', (event, uri) => {
if (!win) {
// Window not created yet, so store up requested URI for when it is
openUri = uri;
} else {
win.webContents.send('open-uri-requested', uri);
}
});
} else if (process.argv.length >= 3) {
// No open-url event on Win, but we can still handle URIs provided at launch time
win.webContents.send('open-uri-requested', process.argv[2]);
}

View file

@ -1,6 +1,6 @@
{
"name": "LBRY",
"version": "0.10.0rc9",
"version": "0.10.0",
"main": "main.js",
"description": "LBRY is a fully decentralized, open-source protocol facilitating the discovery, access, and (sometimes) purchase of data.",
"author": {

View file

@ -32,11 +32,19 @@
},
"backgroundColor": "155B4A"
},
"protocols": [{
"name": "lbry",
"role": "Viewer",
"schemes": ["lbry"]
}],
"linux": {
"target": "deb"
},
"win": {
"target": "nsis"
},
"nsis": {
"perMachine": true
}
},
"devDependencies": {

View file

@ -13,5 +13,6 @@ const app = {
logs.push(message);
}
}
global.app = app;
module.exports = app;

View file

@ -28,7 +28,7 @@ export const Modal = React.createClass({
return (
<ReactModal onCloseRequested={this.props.onAborted || this.props.onConfirmed} {...this.props}
className={(this.props.className || '') + ' modal'}
overlayClassName={[null, undefined, ""].indexOf(this.props.overlayClassName) === -1 ? this.props.overlayClassName : 'modal-overlay'}>
overlayClassName={![null, undefined, ""].includes(this.props.overlayClassName) ? this.props.overlayClassName : 'modal-overlay'}>
<div>
{this.props.children}
</div>

View file

@ -16,7 +16,7 @@ import {
} from 'actions/app'
import parseQueryParams from 'util/query_params'
const {remote} = require('electron');
const {remote, ipcRenderer} = require('electron');
const contextMenu = remote.require('./menu/context-menu');
const app = require('./app')
@ -36,21 +36,19 @@ window.addEventListener('popstate', (event) => {
app.store.dispatch(doChangePath(`${pathname}${queryString}`))
})
ipcRenderer.on('open-uri-requested', (event, uri) => {
console.log('FIX ME do magic dispatch');
});
const initialState = app.store.getState();
app.store.subscribe(runTriggers);
runTriggers();
var init = function() {
window.lbry = lbry;
window.lighthouse = lighthouse;
let canvas = document.getElementById('canvas');
lbry.connect().then(function(isConnected) {
lbryio.authenticate() //start auth process as soon as soon as we can get an install ID
})
function onDaemonReady() {
app.store.dispatch(doDaemonReady())
window.sessionStorage.setItem('loaded', 'y'); //once we've made it here once per session, we don't need to show splash again
window.history.pushState({}, "Discover", '/discover');
ReactDOM.render(<Provider store={store}><div>{ lbryio.enabled ? <AuthOverlay/> : '' }<App /><SnackBar /></div></Provider>, canvas)
}

View file

@ -89,7 +89,6 @@ reducers[types.UPGRADE_DOWNLOAD_PROGRESSED] = function(state, action) {
}
reducers[types.DAEMON_READY] = function(state, action) {
window.sessionStorage.setItem('loaded', 'y')
return Object.assign({}, state, {
daemonReady: true
})

View file

@ -1,6 +1,6 @@
{
"name": "lbry-web-ui",
"version": "0.10.0rc9",
"version": "0.10.0",
"description": "LBRY UI",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",