mirror of
https://github.com/desktop/desktop
synced 2024-10-02 14:23:59 +00:00
Wait to show the window until we've loaded
This commit is contained in:
parent
da3432cd14
commit
2a591c8060
|
@ -58,8 +58,6 @@ export default class AppWindow {
|
|||
this.window.webContents.openDevTools()
|
||||
}
|
||||
|
||||
this.window.show()
|
||||
|
||||
const now = Date.now()
|
||||
this.sharedProcess.console.log(`Loading: ${now - startLoad}ms`)
|
||||
})
|
||||
|
@ -135,6 +133,11 @@ export default class AppWindow {
|
|||
this.window.focus()
|
||||
}
|
||||
|
||||
/** Show the window. */
|
||||
public show() {
|
||||
this.window.show()
|
||||
}
|
||||
|
||||
/** Send the menu event to the renderer. */
|
||||
public sendMenuEvent(name: MenuEvent) {
|
||||
this.window.webContents.send('menu-event', { name })
|
||||
|
|
|
@ -112,6 +112,10 @@ app.on('ready', () => {
|
|||
fatalError(`Unknown menu id: ${id}`)
|
||||
}
|
||||
})
|
||||
|
||||
ipcMain.on('show-main-window', () => {
|
||||
getMainWindow().show()
|
||||
})
|
||||
})
|
||||
|
||||
app.on('activate', () => {
|
||||
|
|
|
@ -12,6 +12,7 @@ import { URLActionType } from '../lib/parse-url'
|
|||
import Repository from '../models/repository'
|
||||
import { find } from '../lib/find'
|
||||
import { getDefaultDir } from './lib/default-dir'
|
||||
import { showMainWindow } from './main-process-proxy'
|
||||
|
||||
if (!process.env.TEST_ENV) {
|
||||
/* This is the magic trigger for webpack to go compile
|
||||
|
@ -23,7 +24,9 @@ const appStore = new AppStore()
|
|||
const gitUserStore = new GitUserStore(new GitUserDatabase('GitUserDatabase'))
|
||||
const cloningRepositoriesStore = new CloningRepositoriesStore()
|
||||
const dispatcher = new Dispatcher(appStore, gitUserStore, cloningRepositoriesStore)
|
||||
dispatcher.loadInitialState()
|
||||
dispatcher.loadInitialState().then(() => {
|
||||
showMainWindow()
|
||||
})
|
||||
|
||||
document.body.classList.add(`platform-${process.platform}`)
|
||||
|
||||
|
|
|
@ -10,3 +10,8 @@ export function showPopupAppMenu() {
|
|||
export function setMenuEnabled(id: MenuIDs, enabled: boolean) {
|
||||
ipcRenderer.send('set-menu-enabled', [ { id, enabled } ])
|
||||
}
|
||||
|
||||
/** Show the main window. */
|
||||
export function showMainWindow() {
|
||||
ipcRenderer.send('show-main-window')
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue