This commit is contained in:
crusader 2018-10-02 21:42:02 +09:00
parent df1c926c67
commit 5a0f024519
2 changed files with 6 additions and 4 deletions

View File

@ -185,8 +185,6 @@ export class AppWindow {
registerWindowStateChangedEvents(this.window); registerWindowStateChangedEvents(this.window);
console.log(`NODE_ENV: ${process.env.NODE_ENV}`);
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
const indexUrl = URL.format({ const indexUrl = URL.format({
pathname: path.join('//localhost:4200'), pathname: path.join('//localhost:4200'),

View File

@ -186,8 +186,8 @@ app.on('ready', () => {
return; return;
} }
const dbPath = __DEV__ ? const dbPath = __DEV__
path.join(__dirname, '..', '..', 'config', '_database.sqlite') ? path.join(__dirname, '..', '..', 'config', '_database.sqlite')
: path.join(__dirname, '..', '..', 'bin', 'database.sqlite'); : path.join(__dirname, '..', '..', 'bin', 'database.sqlite');
@ -410,6 +410,8 @@ app.on('web-contents-created', (event, contents) => {
}); });
app.on('before-quit', function (event) { app.on('before-quit', function (event) {
console.log(`before-quit`);
event.preventDefault(); event.preventDefault();
if (null !== db) { if (null !== db) {
@ -458,6 +460,8 @@ function createWindow() {
} }
window.onClose(() => { window.onClose(() => {
console.log(`closed`);
mainWindow = null; mainWindow = null;
if (!__DARWIN__ && !preventQuit) { if (!__DARWIN__ && !preventQuit) {
app.quit(); app.quit();