View updates

This commit is contained in:
2022-12-10 18:15:24 +01:00
parent ad0bc8a945
commit 1a27bedc95
7 changed files with 15 additions and 17 deletions

View File

@@ -50,11 +50,10 @@ export class LoginPageComponent implements OnInit {
email: responsePayload.email, email: responsePayload.email,
avatar: responsePayload.picture avatar: responsePayload.picture
}); });
await this.auth$.getAPIToken(response.credential);
this.auth$.ping();
this.ngZone$.run(() => { this.ngZone$.run(() => {
this.router$.navigate(['/app']); this.router$.navigate(['/app']);
}); });
await this.auth$.getAPIToken(response.credential);
} catch (e) { } catch (e) {
console.error('Get user error', e); console.error('Get user error', e);
} }

View File

@@ -14,7 +14,7 @@ export class LoaderInterceptor implements HttpInterceptor {
private tasks: number = 0; private tasks: number = 0;
constructor( constructor(
private _data: DataService private data$: DataService
) { } ) { }
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> { intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
@@ -29,14 +29,14 @@ export class LoaderInterceptor implements HttpInterceptor {
addTask() { addTask() {
this.tasks++; this.tasks++;
if (this.tasks === 1) { if (this.tasks === 1) {
this._data.showLoader.next(true); this.data$.showLoader.next(true);
} }
} }
removeTask() { removeTask() {
this.tasks--; this.tasks--;
if (this.tasks === 0) { if (this.tasks === 0) {
this._data.showLoader.next(false); this.data$.showLoader.next(false);
} }
} }
} }

View File

@@ -1,12 +1,12 @@
<div class="loading-container" *ngIf="loading"> <div class="loading-container" *ngIf="loading">
<img class="loading-img" src="../../assets/loader.gif" /> <img class="loading-img" src="../../assets/loader.gif" />
</div> </div>
<div class="flip-container" *ngIf="device$.flipPhone"> <div class="flip-container" *ngIf="device$.flipPhone">
<div class="flip-msg"> <div class="flip-msg">
Obróć telefon.<br> Obróć telefon.<br>
<mat-icon>screen_rotation</mat-icon> <mat-icon>screen_rotation</mat-icon>
</div> </div>
</div> </div>
<div class="main-container"> <div class="main-container">
<mat-toolbar color="primary"> <mat-toolbar color="primary">
<button mat-icon-button (click)="snav.toggle()"> <button mat-icon-button (click)="snav.toggle()">

View File

@@ -26,7 +26,7 @@ export class MainViewComponent {
public device$: DeviceService, public device$: DeviceService,
private router$: Router, private router$: Router,
private swUpdate$: SwUpdate, private swUpdate$: SwUpdate,
) { ) {
this.swUpdate$.versionUpdates.subscribe(() => { this.swUpdate$.versionUpdates.subscribe(() => {
this.reloadApp(); this.reloadApp();
}); });
@@ -37,11 +37,10 @@ export class MainViewComponent {
}); });
//listen to loading subject //listen to loading subject
data$.showLoader.pipe(delay(0)).subscribe(loading => { data$.showLoader.subscribe(loading => {
this.loading = loading; this.loading = loading;
}) });
} }
reloadApp() { reloadApp() {
document.location.reload(); document.location.reload();
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

@@ -5,8 +5,8 @@
export const environment = { export const environment = {
production: false, production: false,
api: { api: {
url: "http://localhost:5400/api" //url: "http://localhost:5400/api"
//url: "https://diuna.bim-it.pl/api" url: "https://diuna.bim-it.pl/api"
}, },
google: { google: {
clientId: "107631825312-bkfe438ehr9k9ecb2h76g802tj6advma.apps.googleusercontent.com" clientId: "107631825312-bkfe438ehr9k9ecb2h76g802tj6advma.apps.googleusercontent.com"

View File

@@ -2,7 +2,7 @@
"name": "Diuna", "name": "Diuna",
"short_name": "Diuna", "short_name": "Diuna",
"theme_color": "#FF9800", "theme_color": "#FF9800",
"background_color": "#FF9800", "background_color": "#fafafa",
"display": "standalone", "display": "standalone",
"scope": "./", "scope": "./",
"start_url": "./", "start_url": "./",