mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 01:54:40 +08:00
fix(win): speed up composer launching
This commit is contained in:
parent
fd61995b92
commit
a8413c8e2f
3 changed files with 10 additions and 4 deletions
|
@ -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() {
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue