First commit

This commit is contained in:
2026-04-08 19:36:03 +02:00
parent 66769b52fd
commit 3fb1145c6b
37 changed files with 2498 additions and 494 deletions

View File

@@ -0,0 +1,35 @@
import {Component, inject, input, OnInit, signal} from '@angular/core';
import {ChatService} from '@chatenium/chatenium-sdk/services/chatService';
import {IndexedDB} from '../../storage/indexed-db';
import {Chat} from '@chatenium/chatenium-sdk/domain/chatService.schema';
import {JsonPipe} from '@angular/common';
@Component({
selector: 'app-dm-list',
imports: [
JsonPipe
],
templateUrl: './dm-list.html',
styleUrl: './dm-list.scss',
})
export class DmList implements OnInit {
userid = input<string>("")
token = input<string>("")
indexedDb = inject(IndexedDB)
service: ChatService | null = null
chats = signal<Chat[]>([])
chatsStatus = 0
async ngOnInit() {
this.service = new ChatService(this.userid(), this.token(), this.indexedDb.getApi(), () => {})
try {
this.chats.set(await this.service.get())
this.chatsStatus = 1
} catch (e) {
console.error(e)
this.chatsStatus = 2
}
}
}