Merge branch 'master' of https://git.loafle.net/ucap-web/next-ucap-messenger
This commit is contained in:
commit
94b714871a
|
@ -5,7 +5,6 @@ import { app, BrowserWindow, screen, ipcMain, IpcMainEvent } from 'electron';
|
|||
import windowStateKeeper from 'electron-window-state';
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
import { now } from '../util/now';
|
||||
import { registerWindowStateChangedEvents } from '../lib/window-state';
|
||||
import {
|
||||
ElectronAppChannel,
|
||||
|
@ -13,6 +12,9 @@ import {
|
|||
ElectronWebContentsChannel
|
||||
} from '@ucap-webmessenger/electron-core';
|
||||
|
||||
import { appStorage } from '../lib/storage';
|
||||
import { now } from '../util/now';
|
||||
|
||||
export class AppWindow {
|
||||
private window: BrowserWindow | null = null;
|
||||
|
||||
|
@ -55,7 +57,8 @@ export class AppWindow {
|
|||
nodeIntegration: true
|
||||
},
|
||||
acceptFirstMouse: true,
|
||||
icon: this.appIconPath
|
||||
icon: this.appIconPath,
|
||||
show: false
|
||||
};
|
||||
|
||||
if (__DARWIN__) {
|
||||
|
@ -117,6 +120,9 @@ export class AppWindow {
|
|||
// can be tidied up once https://github.com/electron/electron/issues/12971
|
||||
// has been confirmed as resolved
|
||||
this.window.once(ElectronBrowserWindowChannel.ReadyToShow, () => {
|
||||
if (!appStorage.startupHideWindow) {
|
||||
this.window.show();
|
||||
}
|
||||
this.window.on(ElectronBrowserWindowChannel.Unmaximize, () => {
|
||||
setTimeout(() => {
|
||||
const bounds = this.window.getBounds();
|
||||
|
|
|
@ -55,7 +55,7 @@ import {
|
|||
import log from 'electron-log';
|
||||
|
||||
import { RendererUpdater } from './lib/renderer-updater';
|
||||
import { Storage } from './lib/storage';
|
||||
import { appStorage } from './lib/storage';
|
||||
|
||||
const appIconPath = __LINUX__
|
||||
? __DEV__
|
||||
|
@ -88,7 +88,6 @@ let preventQuit = false;
|
|||
|
||||
let notificationService: ElectronNotificationService | null;
|
||||
let updateWindowService: ElectronUpdateWindowService | null;
|
||||
const appStorage: Storage = new Storage();
|
||||
|
||||
function handleUncaughtException(error: Error) {
|
||||
preventQuit = true;
|
||||
|
|
|
@ -45,3 +45,5 @@ export class Storage {
|
|||
this.store.set(STORE_KEY_DOWNLOADFOLDER, downloadPath);
|
||||
}
|
||||
}
|
||||
|
||||
export const appStorage: Storage = new Storage();
|
||||
|
|
Loading…
Reference in New Issue
Block a user