bug of reload app is fixed

This commit is contained in:
richard-loafle 2020-02-11 16:35:37 +09:00
parent 3015b5ef87
commit 559873d0db
2 changed files with 8 additions and 4 deletions

View File

@ -140,7 +140,7 @@ export class AppWindow {
} }
} }
public load(): void { public load(hashUrl?: string): void {
let startLoad = 0; let startLoad = 0;
this.window.webContents.once( this.window.webContents.once(
@ -176,7 +176,7 @@ export class AppWindow {
isMainFrame: boolean isMainFrame: boolean
) => { ) => {
if ('ERR_FILE_NOT_FOUND' === errorDescription) { if ('ERR_FILE_NOT_FOUND' === errorDescription) {
this.load(); this.load(url.parse(validatedURL).hash);
return; return;
} }
log.error( log.error(
@ -187,6 +187,7 @@ export class AppWindow {
validatedURL, validatedURL,
isMainFrame isMainFrame
); );
this.window.webContents.openDevTools(); this.window.webContents.openDevTools();
} }
); );
@ -204,7 +205,8 @@ export class AppWindow {
'ucap-webmessenger-app/index.html' 'ucap-webmessenger-app/index.html'
), ),
protocol: 'file:', protocol: 'file:',
slashes: true slashes: true,
hash: hashUrl
}) })
); );
} }

View File

@ -29,7 +29,9 @@ const routes: Routes = [
]; ];
@NgModule({ @NgModule({
imports: [RouterModule.forRoot(routes, { enableTracing: false })], imports: [
RouterModule.forRoot(routes, { useHash: true, enableTracing: false })
],
exports: [RouterModule] exports: [RouterModule]
}) })
export class AppRoutingModule {} export class AppRoutingModule {}