bug fixed
This commit is contained in:
parent
748db5a757
commit
ebddfb20c5
|
@ -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.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();
|
||||
this.window.show();
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
registerWindowStateChangedEvents(this.window);
|
||||
|
||||
|
|
|
@ -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 {}
|
||||
|
|
Loading…
Reference in New Issue
Block a user