diff --git a/images/userdropdown@2x.png b/images/userdropdown@2x.png new file mode 100644 index 0000000000..dab8b11562 Binary files /dev/null and b/images/userdropdown@2x.png differ diff --git a/src/actions/AccountActions.js b/src/actions/AccountActions.js index ff2807de34..059f956a17 100644 --- a/src/actions/AccountActions.js +++ b/src/actions/AccountActions.js @@ -2,7 +2,7 @@ import alt from '../alt'; import hub from '../utils/HubUtil'; class AccountActions { - login(username, password) { + login (username, password) { this.dispatch({}); hub.login(username, password); } @@ -12,8 +12,14 @@ class AccountActions { hub.signup(username, password, email, subscribe); } + logout () { + this.dispatch({}); + hub.logout(); + } + skip () { this.dispatch({}); + hub.prompted(true); } } diff --git a/src/actions/AccountServerActions.js b/src/actions/AccountServerActions.js index 24b9d514d6..758a6adaae 100644 --- a/src/actions/AccountServerActions.js +++ b/src/actions/AccountServerActions.js @@ -5,13 +5,16 @@ import router from '../router'; class AccountServerActions { constructor () { this.generateActions( + 'loggedout', + 'prompted', 'errors' ); } loggedin ({username, verified}) { - console.log(username, verified); - router.get().goBack(); + if (router.get()) { + router.get().goBack(); + } this.dispatch({username, verified}); } diff --git a/src/actions/RepositoryServerActions.js b/src/actions/RepositoryServerActions.js index 0fa5cb03d1..ffb2e2166c 100644 --- a/src/actions/RepositoryServerActions.js +++ b/src/actions/RepositoryServerActions.js @@ -3,6 +3,7 @@ import alt from '../alt'; class RepositoryServerActions { constructor () { this.generateActions( + 'searched', 'fetched', 'error' ); diff --git a/src/app.js b/src/app.js index f7e370b651..243070d656 100644 --- a/src/app.js +++ b/src/app.js @@ -9,6 +9,7 @@ var metrics = require('./utils/MetricsUtil'); var router = require('./router'); var template = require('./menutemplate'); var webUtil = require('./utils/WebUtil'); +var hubUtil = require('./utils/HubUtil'); var urlUtil = require ('./utils/URLUtil'); var app = remote.require('app'); var request = require('request'); @@ -24,6 +25,8 @@ webUtil.addLiveReload(); webUtil.addBugReporting(); webUtil.disableGlobalBackspace(); +hubUtil.init(); + Menu.setApplicationMenu(Menu.buildFromTemplate(template())); metrics.track('Started App'); diff --git a/src/browser.js b/src/browser.js index 0299b8afbf..e033f86f75 100644 --- a/src/browser.js +++ b/src/browser.js @@ -27,10 +27,10 @@ app.on('open-url', function (event, url) { app.on('ready', function () { var mainWindow = new BrowserWindow({ - width: size.width || 1000, - height: size.height || 700, - 'min-width': 1000, - 'min-height': 700, + width: size.width || 800, + height: size.height || 600, + 'min-width': 800, + 'min-height': 600, 'standard-window': false, resizable: true, frame: false, diff --git a/src/components/Account.react.js b/src/components/Account.react.js index 341762be8e..1118d03948 100644 --- a/src/components/Account.react.js +++ b/src/components/Account.react.js @@ -13,6 +13,16 @@ module.exports = React.createClass({ return accountStore.getState(); }, + componentDidMount: function () { + document.addEventListener('keyup', this.handleDocumentKeyUp, false); + accountStore.listen(this.update); + }, + + componentWillUnmount: function () { + document.removeEventListener('keyup', this.handleDocumentKeyUp, false); + accountStore.unlisten(this.update); + }, + handleSkip: function () { accountActions.skip(); this.transitionTo('search'); @@ -24,17 +34,13 @@ module.exports = React.createClass({ metrics.track('Closed Signup'); }, - componentDidMount: function () { - accountStore.listen(this.update); - }, - update: function () { this.setState(accountStore.getState()); }, render: function () { let close = this.state.prompted ? - Close : + Close : Skip For Now; return ( diff --git a/src/components/AccountLogin.react.js b/src/components/AccountLogin.react.js index 9757664937..6070f32292 100644 --- a/src/components/AccountLogin.react.js +++ b/src/components/AccountLogin.react.js @@ -16,7 +16,9 @@ module.exports = React.createClass({ errors: {} }; }, - + componentDidMount: function () { + React.findDOMNode(this.refs.usernameInput).focus(); + }, componentWillReceiveProps: function (nextProps) { this.setState({errors: nextProps.errors}); }, @@ -50,7 +52,7 @@ module.exports = React.createClass({ handleClickSignup: function () { if (!this.props.loading) { - this.transitionTo('signup'); + this.replaceWith('signup'); } }, @@ -59,11 +61,10 @@ module.exports = React.createClass({ }, render: function () { - console.log(this.state.errors); let loading = this.props.loading ?