View updates
This commit is contained in:
@@ -50,11 +50,10 @@ export class LoginPageComponent implements OnInit {
|
||||
email: responsePayload.email,
|
||||
avatar: responsePayload.picture
|
||||
});
|
||||
await this.auth$.getAPIToken(response.credential);
|
||||
this.auth$.ping();
|
||||
this.ngZone$.run(() => {
|
||||
this.router$.navigate(['/app']);
|
||||
});
|
||||
await this.auth$.getAPIToken(response.credential);
|
||||
} catch (e) {
|
||||
console.error('Get user error', e);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ export class LoaderInterceptor implements HttpInterceptor {
|
||||
private tasks: number = 0;
|
||||
|
||||
constructor(
|
||||
private _data: DataService
|
||||
private data$: DataService
|
||||
) { }
|
||||
|
||||
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
|
||||
@@ -29,14 +29,14 @@ export class LoaderInterceptor implements HttpInterceptor {
|
||||
addTask() {
|
||||
this.tasks++;
|
||||
if (this.tasks === 1) {
|
||||
this._data.showLoader.next(true);
|
||||
this.data$.showLoader.next(true);
|
||||
}
|
||||
}
|
||||
|
||||
removeTask() {
|
||||
this.tasks--;
|
||||
if (this.tasks === 0) {
|
||||
this._data.showLoader.next(false);
|
||||
this.data$.showLoader.next(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<div class="loading-container" *ngIf="loading">
|
||||
<img class="loading-img" src="../../assets/loader.gif" />
|
||||
</div>
|
||||
<div class="flip-container" *ngIf="device$.flipPhone">
|
||||
</div>
|
||||
<div class="flip-container" *ngIf="device$.flipPhone">
|
||||
<div class="flip-msg">
|
||||
Obróć telefon.<br>
|
||||
<mat-icon>screen_rotation</mat-icon>
|
||||
Obróć telefon.<br>
|
||||
<mat-icon>screen_rotation</mat-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-container">
|
||||
<mat-toolbar color="primary">
|
||||
<button mat-icon-button (click)="snav.toggle()">
|
||||
|
||||
@@ -26,7 +26,7 @@ export class MainViewComponent {
|
||||
public device$: DeviceService,
|
||||
private router$: Router,
|
||||
private swUpdate$: SwUpdate,
|
||||
) {
|
||||
) {
|
||||
this.swUpdate$.versionUpdates.subscribe(() => {
|
||||
this.reloadApp();
|
||||
});
|
||||
@@ -37,11 +37,10 @@ export class MainViewComponent {
|
||||
});
|
||||
|
||||
//listen to loading subject
|
||||
data$.showLoader.pipe(delay(0)).subscribe(loading => {
|
||||
data$.showLoader.subscribe(loading => {
|
||||
this.loading = loading;
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
reloadApp() {
|
||||
document.location.reload();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user