2022-11-29 19:21:24 +01:00
|
|
|
import { Component, ViewChild } from '@angular/core';
|
|
|
|
|
import { MatSidenav } from '@angular/material/sidenav';
|
2022-12-05 17:42:52 +01:00
|
|
|
import { Router } from '@angular/router';
|
2022-11-29 19:21:24 +01:00
|
|
|
import * as moment from 'moment';
|
|
|
|
|
import packageInfo from 'package.json';
|
|
|
|
|
import { DataService } from '../services/data.service';
|
|
|
|
|
import { DeviceService } from '../services/device.service';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-main-view',
|
|
|
|
|
templateUrl: './main-view.component.html',
|
|
|
|
|
styleUrls: ['./main-view.component.scss']
|
|
|
|
|
})
|
2022-12-05 14:20:34 +01:00
|
|
|
export class MainViewComponent {
|
2022-11-29 19:21:24 +01:00
|
|
|
@ViewChild('snav') snav?: MatSidenav;
|
|
|
|
|
appVersion = packageInfo.version;
|
|
|
|
|
|
|
|
|
|
submenus = {
|
|
|
|
|
administration: false,
|
|
|
|
|
};
|
|
|
|
|
currentDate = moment().toDate();
|
|
|
|
|
flipPhone: boolean = false;
|
|
|
|
|
loading: boolean = false;
|
|
|
|
|
|
|
|
|
|
constructor(
|
2022-12-05 17:42:52 +01:00
|
|
|
public data$: DataService,
|
|
|
|
|
public device$: DeviceService,
|
|
|
|
|
private router$: Router
|
2022-11-29 21:25:19 +01:00
|
|
|
) { }
|
|
|
|
|
|
2022-11-29 19:21:24 +01:00
|
|
|
reloadApp() {
|
|
|
|
|
document.location.reload();
|
|
|
|
|
}
|
|
|
|
|
logout() {
|
2022-12-05 17:42:52 +01:00
|
|
|
// @ts-ignore
|
|
|
|
|
google.accounts.id.disableAutoSelect();
|
|
|
|
|
this.router$.navigate(['']);
|
|
|
|
|
this.data$.currentUser = null;
|
2022-11-29 19:21:24 +01:00
|
|
|
}
|
|
|
|
|
}
|