-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #523 from Kyusung4698/develop
0.6.16 (2020-03-31)
- Loading branch information
Showing
39 changed files
with
266 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { Injectable, NgZone } from '@angular/core'; | ||
import { ElectronProvider } from '@app/provider'; | ||
import { IpcRenderer, Remote, Session } from 'electron'; | ||
import { forkJoin, from, Observable, of } from 'rxjs'; | ||
import { map } from 'rxjs/operators'; | ||
import { LoggerService } from './logger.service'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class SessionService { | ||
private readonly electron: Remote; | ||
private readonly ipcRenderer: IpcRenderer; | ||
|
||
constructor( | ||
private readonly ngZone: NgZone, | ||
private readonly logger: LoggerService, | ||
electronProvider: ElectronProvider) { | ||
this.electron = electronProvider.provideRemote(); | ||
this.ipcRenderer = electronProvider.provideIpcRenderer(); | ||
} | ||
|
||
public registerEvents(): void { | ||
this.ipcRenderer.on('session-clear', () => { | ||
this.ngZone.run(() => this.clear().subscribe()); | ||
}); | ||
this.clear().subscribe(); | ||
} | ||
|
||
public clear(): Observable<void> { | ||
const tasks = [ | ||
this.clearCache(), | ||
this.clearHostResolverCache() | ||
]; | ||
|
||
return forkJoin(tasks).pipe( | ||
map(() => null) | ||
); | ||
} | ||
|
||
public clearCache(): Observable<void> { | ||
const session = this.getSession(); | ||
if (!session) { | ||
this.logger.warn('Could not clear cache because session was null or undefined.'); | ||
return of(null); | ||
} | ||
this.logger.info('Session cache has been cleared.'); | ||
return from(session.clearCache()); | ||
} | ||
|
||
public clearHostResolverCache(): Observable<void> { | ||
const session = this.getSession(); | ||
if (!session) { | ||
this.logger.warn('Could not clear cache because session was null or undefined.'); | ||
return of(null); | ||
} | ||
this.logger.info('Session host resolver cache has been cleared.'); | ||
return from(session.clearHostResolverCache()); | ||
} | ||
|
||
private getSession(): Session { | ||
return this.electron.session?.defaultSession; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,7 @@ label { | |
} | ||
} | ||
|
||
.time { | ||
.value-range { | ||
.mat-slider { | ||
width: 100%; | ||
} | ||
|
Oops, something went wrong.