bug fixed

This commit is contained in:
richard-loafle 2020-02-07 13:33:30 +09:00
parent 748db5a757
commit ebddfb20c5
2 changed files with 31 additions and 9 deletions

View File

@ -5,6 +5,8 @@ import { app, BrowserWindow, screen, ipcMain, IpcMainEvent } from 'electron';
import windowStateKeeper from 'electron-window-state'; import windowStateKeeper from 'electron-window-state';
import { EventEmitter } from 'events'; import { EventEmitter } from 'events';
import log from 'electron-log';
import { registerWindowStateChangedEvents } from '../lib/window-state'; import { registerWindowStateChangedEvents } from '../lib/window-state';
import { import {
ElectronAppChannel, ElectronAppChannel,
@ -164,10 +166,30 @@ export class AppWindow {
} }
); );
this.window.webContents.on(ElectronWebContentsChannel.DidFailLoad, () => { this.window.webContents.on(
this.window.webContents.openDevTools(); ElectronWebContentsChannel.DidFailLoad,
this.window.show(); (
}); event: Event,
errorCode: number,
errorDescription: string,
validatedURL: string,
isMainFrame: boolean
) => {
if ('ERR_FILE_NOT_FOUND' === errorDescription) {
this.load();
return;
}
log.error(
ElectronWebContentsChannel.DidFailLoad,
event,
errorCode,
errorDescription,
validatedURL,
isMainFrame
);
this.window.webContents.openDevTools();
}
);
registerWindowStateChangedEvents(this.window); registerWindowStateChangedEvents(this.window);

View File

@ -10,26 +10,26 @@ const routes: Routes = [
import('./pages/messenger/messenger.page.module').then( import('./pages/messenger/messenger.page.module').then(
m => m.AppMessengerPageModule m => m.AppMessengerPageModule
), ),
canActivate: [AppAuthGuard], canActivate: [AppAuthGuard]
}, },
{ {
path: 'account', path: 'account',
loadChildren: () => loadChildren: () =>
import('./pages/account/account.page.module').then( import('./pages/account/account.page.module').then(
m => m.AppAccountPageModule m => m.AppAccountPageModule
), )
}, },
{ {
path: 'template', path: 'template',
loadChildren: () => loadChildren: () =>
import('./pages/template/template.page.module').then( import('./pages/template/template.page.module').then(
m => m.AppTemplatePageModule m => m.AppTemplatePageModule
), )
}, }
]; ];
@NgModule({ @NgModule({
imports: [RouterModule.forRoot(routes, { enableTracing: false })], imports: [RouterModule.forRoot(routes, { enableTracing: false })],
exports: [RouterModule], exports: [RouterModule]
}) })
export class AppRoutingModule {} export class AppRoutingModule {}