1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

Discard finder (#1497)

* Discard finder

* Upgrade electron

* Discard anything related with finder

* Fix lint errors

* Run test serial

* Test on v6

* Test on v6 only
This commit is contained in:
Junyoung Choi (Sai)
2018-02-03 23:39:53 +09:00
committed by GitHub
parent 922570bb5c
commit 51a8c47afd
28 changed files with 14 additions and 1732 deletions

View File

@@ -4,10 +4,11 @@ const BrowserWindow = electron.BrowserWindow
const path = require('path')
const Config = require('electron-config')
const config = new Config()
const _ = require('lodash')
var showMenu = process.platform !== 'win32'
const windowSize = config.get('windowsize') || { width: 1080, height: 720 }
console.log(windowSize)
const mainWindow = new BrowserWindow({
width: windowSize.width,
height: windowSize.height,
@@ -57,26 +58,21 @@ if (process.platform !== 'linux' || process.env.DESKTOP_SESSION === 'cinnamon')
})
app.on('before-quit', function (e) {
storeWindowSize()
mainWindow.removeAllListeners()
})
} else {
mainWindow.on('close', function () {
storeWindowSize()
})
app.on('window-all-closed', function () {
app.quit()
})
}
mainWindow.on('resize', _.throttle(storeWindowSize, 500))
function quitApp () {
storeWindowSize()
app.quit()
}
function storeWindowSize () {
try {
console.log(mainWindow.getBounds())
config.set('windowsize', mainWindow.getBounds())
} catch (e) {
// ignore any errors because an error occurs only on update