Files
ipwa/src/app/app.component.ts
T
slasherss 06316e1715 Squashed 'frontend/' content from commit 63375d1
git-subtree-dir: frontend
git-subtree-split: 63375d198b2160a3a5fc4427efe888f6c37bd92f
2026-04-27 22:43:56 +02:00

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'
}