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 { EventEmitter } from 'events';
import log from 'electron-log';
import { registerWindowStateChangedEvents } from '../lib/window-state';
import {
ElectronAppChannel,
@ -164,10 +166,30 @@ export class AppWindow {
}
);
this.window.webContents.on(ElectronWebContentsChannel.DidFailLoad, () => {
this.window.webContents.openDevTools();
this.window.show();
});
this.window.webContents.on(
ElectronWebContentsChannel.DidFailLoad,
(
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);

View File

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