mirror of
https://github.com/desktop/desktop
synced 2024-06-30 22:54:41 +00:00
Merge pull request #326 from desktop/bloading
Wait to show the window until we've loaded
This commit is contained in:
commit
a5193a71fe
|
@ -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', () => {
|
||||
|
|
|
@ -11,6 +11,7 @@ import { Dispatcher, AppStore, GitUserStore, GitUserDatabase, CloningRepositorie
|
|||
import { URLActionType } from '../lib/parse-url'
|
||||
import Repository from '../models/repository'
|
||||
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
|
||||
|
@ -22,7 +23,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 New Issue
Block a user