06316e1715
git-subtree-dir: frontend git-subtree-split: 63375d198b2160a3a5fc4427efe888f6c37bd92f
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { Component, inject, LOCALE_ID, OnInit } from '@angular/core'
|
|
import { AppUpdateService } from './services/app-update.service'
|
|
import { MatIconRegistry } from '@angular/material/icon'
|
|
import { Settings } from 'luxon'
|
|
import { LocalStorageService } from './services/local-storage.service'
|
|
import { SyncService } from './services/sync.service'
|
|
import { MatSnackBar } from '@angular/material/snack-bar'
|
|
|
|
@Component({
|
|
selector: 'app-root',
|
|
templateUrl: './app.component.html',
|
|
styleUrls: ['./app.component.scss'],
|
|
standalone: false,
|
|
})
|
|
export class AppComponent implements OnInit {
|
|
readonly updates = inject(AppUpdateService)
|
|
mir = inject(MatIconRegistry)
|
|
lang = inject(LOCALE_ID)
|
|
private ls = inject(LocalStorageService)
|
|
private sync = inject(SyncService)
|
|
private sb = inject(MatSnackBar)
|
|
|
|
|
|
constructor() {
|
|
this.mir.setDefaultFontSetClass('material-symbols-rounded')
|
|
Settings.defaultLocale = this.lang
|
|
}
|
|
|
|
ngOnInit(): void {
|
|
if (this.ls.loggedIn) {
|
|
this.sync.subscribe()
|
|
this.sync.notifEvents.subscribe(v => {
|
|
this.sync.notifCheck()
|
|
})
|
|
}
|
|
}
|
|
|
|
title = 'Internat'
|
|
}
|