3.0 Beta 6
This commit is contained in:
@@ -2,7 +2,7 @@ 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 {TUI_BREAKPOINT, TuiButton} from '@taiga-ui/core';
|
||||
import {TUI_BREAKPOINT, TuiButton, TuiLoader} from '@taiga-ui/core';
|
||||
import {Oimg} from '../elements/oimg/oimg';
|
||||
import {Router, RouterLink} from '@angular/router';
|
||||
import {TranslatePipe} from '@ngx-translate/core';
|
||||
@@ -14,7 +14,8 @@ import {LoadStatus, ServiceManager} from '../../service-manager';
|
||||
TuiButton,
|
||||
Oimg,
|
||||
RouterLink,
|
||||
TranslatePipe
|
||||
TranslatePipe,
|
||||
TuiLoader
|
||||
],
|
||||
templateUrl: './dm-list.html',
|
||||
styleUrl: './dm-list.scss',
|
||||
@@ -30,6 +31,12 @@ export class DmList implements OnInit {
|
||||
|
||||
async ngOnInit() {
|
||||
this.serviceManager.chatService = new ChatService(this.userid(), this.token(), this.indexedDb.getApi(), () => {})
|
||||
try {
|
||||
this.serviceManager.chats.set(await this.serviceManager.chatService.getQuick())
|
||||
this.serviceManager.chatsStatus.set(LoadStatus.updating)
|
||||
} catch (e) {
|
||||
console.warn(`Cache load failed: ${e}. Skipping cache load...`)
|
||||
}
|
||||
try {
|
||||
this.serviceManager.chats.set(await this.serviceManager.chatService.get())
|
||||
this.serviceManager.chatsStatus.set(LoadStatus.loaded)
|
||||
@@ -38,4 +45,6 @@ export class DmList implements OnInit {
|
||||
this.serviceManager.chatsStatus.set(LoadStatus.error)
|
||||
}
|
||||
}
|
||||
|
||||
protected readonly LoadStatus = LoadStatus;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user