First commit
This commit is contained in:
34
src/app/chat/chat.ts
Normal file
34
src/app/chat/chat.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import {Component, inject, OnInit} from '@angular/core';
|
||||
import {RouterOutlet} from '@angular/router';
|
||||
import {TuiSegmented} from '@taiga-ui/kit';
|
||||
import {TuiButton, TuiIcon, TuiLoader} from '@taiga-ui/core';
|
||||
import {SessionManager} from '@chatenium/chatenium-sdk/services/sessionManager';
|
||||
import {ServiceManager} from '../service-manager';
|
||||
import {IndexedDB} from '../storage/indexed-db';
|
||||
import {DmList} from './dm-list/dm-list';
|
||||
import {JsonPipe} from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat',
|
||||
imports: [
|
||||
RouterOutlet,
|
||||
TuiSegmented,
|
||||
TuiIcon,
|
||||
TuiButton,
|
||||
TuiLoader,
|
||||
DmList,
|
||||
JsonPipe
|
||||
],
|
||||
templateUrl: './chat.html',
|
||||
styleUrl: './chat.scss',
|
||||
})
|
||||
export class Chat implements OnInit {
|
||||
serviceManager = inject(ServiceManager)
|
||||
indexedDb = inject(IndexedDB)
|
||||
|
||||
async ngOnInit() {
|
||||
this.indexedDb.openDatabase().then(async () => {
|
||||
this.serviceManager.currentSession.set(await this.serviceManager.sessionManager.loadPreferredSession())
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user