mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
fixed eslint error & integrated with prettier as well as formatted the whole codebase (#3450)
This commit is contained in:
@@ -54,12 +54,17 @@ const mainWindow = new BrowserWindow({
|
||||
},
|
||||
icon: path.resolve(__dirname, '../resources/app.png')
|
||||
})
|
||||
const url = path.resolve(__dirname, process.env.NODE_ENV === 'development' ? './main.development.html' : './main.production.html')
|
||||
const url = path.resolve(
|
||||
__dirname,
|
||||
process.env.NODE_ENV === 'development'
|
||||
? './main.development.html'
|
||||
: './main.production.html'
|
||||
)
|
||||
|
||||
mainWindow.loadURL('file://' + url)
|
||||
mainWindow.setMenuBarVisibility(false)
|
||||
|
||||
mainWindow.webContents.on('new-window', function (e) {
|
||||
mainWindow.webContents.on('new-window', function(e) {
|
||||
e.preventDefault()
|
||||
})
|
||||
|
||||
@@ -74,10 +79,10 @@ mainWindow.webContents.sendInputEvent({
|
||||
})
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
mainWindow.on('close', function (e) {
|
||||
mainWindow.on('close', function(e) {
|
||||
e.preventDefault()
|
||||
if (mainWindow.isFullScreen()) {
|
||||
mainWindow.once('leave-full-screen', function () {
|
||||
mainWindow.once('leave-full-screen', function() {
|
||||
mainWindow.hide()
|
||||
})
|
||||
mainWindow.setFullScreen(false)
|
||||
@@ -86,7 +91,7 @@ if (process.platform === 'darwin') {
|
||||
}
|
||||
})
|
||||
|
||||
app.on('before-quit', function (e) {
|
||||
app.on('before-quit', function(e) {
|
||||
mainWindow.removeAllListeners()
|
||||
})
|
||||
}
|
||||
@@ -94,7 +99,7 @@ if (process.platform === 'darwin') {
|
||||
mainWindow.on('resize', _.throttle(storeWindowSize, 500))
|
||||
mainWindow.on('move', _.throttle(storeWindowSize, 500))
|
||||
|
||||
function storeWindowSize () {
|
||||
function storeWindowSize() {
|
||||
try {
|
||||
config.set('windowsize', mainWindow.getBounds())
|
||||
} catch (e) {
|
||||
@@ -103,7 +108,7 @@ function storeWindowSize () {
|
||||
}
|
||||
}
|
||||
|
||||
app.on('activate', function () {
|
||||
app.on('activate', function() {
|
||||
if (mainWindow == null) return null
|
||||
mainWindow.show()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user