fix(win): speed up composer launching

This commit is contained in:
Evan Morikawa 2016-04-22 17:39:29 -07:00
parent fd61995b92
commit a8413c8e2f
3 changed files with 10 additions and 4 deletions

View file

@ -5,6 +5,7 @@ import {remote} from 'electron';
import {
Message,
Actions,
DraftStore,
ComponentRegistry,
WorkspaceStore,
@ -32,7 +33,7 @@ class ComposerWithWindowProps extends React.Component {
onDraftReady = () => {
this.refs.composer.focus().then(() => {
NylasEnv.displayWindow()
NylasEnv.displayWindow();
if (this.state.errorMessage) {
this._showInitialErrorDialog(this.state.errorMessage);
}
@ -92,12 +93,18 @@ export function activate() {
}
NylasEnv.getCurrentWindow().setMinimumSize(480, 250);
WorkspaceStore.defineSheet('Main', {root: true}, {
const silent = !NylasEnv.isMainWindow()
WorkspaceStore.defineSheet('Main', {root: true, silent}, {
popout: ['Center'],
});
ComponentRegistry.register(ComposerWithWindowProps, {
location: WorkspaceStore.Location.Center,
});
if (silent) {
Actions.selectRootSheet(WorkspaceStore.Sheet.Main)
}
}
export function deactivate() {

View file

@ -221,7 +221,7 @@ class WorkspaceStore extends NylasStore
Header: {id: "Sheet:#{id}:Header"}
Footer: {id: "Sheet:#{id}:Footer"}
if options.root and not @rootSheet()
if (options.root and not @rootSheet()) and not options.silent
@_onSelectRootSheet(Sheet[id])
@triggerDebounced()

View file

@ -728,7 +728,6 @@ class NylasEnvConstructor extends Model
@setWindowDimensions({width, height})
browserWindow = @getCurrentWindow()
if browserWindow.isResizable() isnt loadSettings.resizable
console.log(loadSettings.resizable)
browserWindow.setResizable(loadSettings.resizable)
@displayWindow() unless loadSettings.hidden