Compare commits
11 Commits
56d6065eef
...
next
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
277bbc14d9 | ||
|
|
05e24d768a | ||
|
|
eaa355e40e | ||
|
|
8fc0da520c | ||
|
|
7149ebad10 | ||
|
|
34752b446c | ||
|
|
c18a8c14ca | ||
|
|
bc8501d74c | ||
|
|
76d96067d0 | ||
|
|
aa3494eac0 | ||
|
|
e386608e59 |
8
package-lock.json
generated
8
package-lock.json
generated
@@ -33,7 +33,7 @@
|
||||
"@taiga-ui/icons": "^5.25.0",
|
||||
"@taiga-ui/kit": "^5.25.0",
|
||||
"@taiga-ui/layout": "^5.25.0",
|
||||
"chatenium-sdk-preview": "npm:@chatenium/chatenium-sdk@^2.0.0-preview.6",
|
||||
"chatenium-sdk-preview": "npm:@chatenium/chatenium-sdk@^2.0.0-preview.7",
|
||||
"libphonenumber-js": "^1.12.41",
|
||||
"ngx-cookie-service": "^21.3.1",
|
||||
"ngx-device-detector": "^11.0.0",
|
||||
@@ -5919,9 +5919,9 @@
|
||||
},
|
||||
"node_modules/chatenium-sdk-preview": {
|
||||
"name": "@chatenium/chatenium-sdk",
|
||||
"version": "2.0.0-preview.6",
|
||||
"resolved": "https://registry.npmjs.org/@chatenium/chatenium-sdk/-/chatenium-sdk-2.0.0-preview.6.tgz",
|
||||
"integrity": "sha512-Coj2Hcf9AKdYloNT9y5qLL+B5CwbJq4nZhE4WnEeh8VG9AHiSuoyPK+YeTpLhS+JDUht54bQUFMXu313s824Yg==",
|
||||
"version": "2.0.0-preview.7",
|
||||
"resolved": "https://registry.npmjs.org/@chatenium/chatenium-sdk/-/chatenium-sdk-2.0.0-preview.7.tgz",
|
||||
"integrity": "sha512-ZeUt/od2IkYyHh/h4TGsvdEaDkLZ1lPEN6qrZEhPs5E0EZFg+a8IXi3p/Jt8nZuSW4mmXNkU+53WS5tn4zhoOA==",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@openapitools/openapi-generator-cli": "^2.42.0"
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
"@taiga-ui/icons": "^5.25.0",
|
||||
"@taiga-ui/kit": "^5.25.0",
|
||||
"@taiga-ui/layout": "^5.25.0",
|
||||
"chatenium-sdk-preview": "npm:@chatenium/chatenium-sdk@^2.0.0-preview.6",
|
||||
"chatenium-sdk-preview": "npm:@chatenium/chatenium-sdk@^2.0.0-preview.7",
|
||||
"libphonenumber-js": "^1.12.41",
|
||||
"ngx-cookie-service": "^21.3.1",
|
||||
"ngx-device-detector": "^11.0.0",
|
||||
|
||||
@@ -21,7 +21,7 @@ export const routes: Routes = [
|
||||
component: Chat,
|
||||
canActivate: [authNeededGuard],
|
||||
children: [
|
||||
{ path: 'dm/:chatid', component: Dm },
|
||||
{ path: 'dm/:contactId', component: Dm },
|
||||
{ path: 'picture/:uploaderId', component: See },
|
||||
{ path: 'network/:networkId/:categoryId/:channelId', component: Text },
|
||||
],
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { Cache } from './cache';
|
||||
import { CacheService } from './cache';
|
||||
|
||||
describe('Cache', () => {
|
||||
let service: Cache;
|
||||
let service: CacheService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(Cache);
|
||||
service = TestBed.inject(CacheService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
import { Injectable, signal } from '@angular/core';
|
||||
import { Contact } from 'chatenium-sdk-preview';
|
||||
import { Injectable, signal, WritableSignal } from '@angular/core';
|
||||
import { MessagesViewModel } from './chat/elements/messages/messages-viewmodel';
|
||||
import { MessageBoxViewModel } from './chat/elements/message-box/message-box-viewmodel';
|
||||
import {WrappedDMHandler, DirectMessagingApi, Contact, Message} from "chatenium-sdk-preview"
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class Cache {
|
||||
contacts = signal<Contact[]>([])
|
||||
contactsState = signal<LoadState>(LoadState.CLEAN_LOADING)
|
||||
export class CacheService {
|
||||
contacts = signal<Contact[]>([]);
|
||||
contactsState = signal<LoadState>(LoadState.CLEAN_LOADING);
|
||||
|
||||
dms = signal<Record<string, DmStorage>>({});
|
||||
}
|
||||
|
||||
export enum LoadState {
|
||||
CLEAN_LOADING,
|
||||
CACHE_UPDATING,
|
||||
LOADED,
|
||||
ERROR
|
||||
ERROR,
|
||||
}
|
||||
|
||||
export interface DmStorage {
|
||||
handler: WrappedDMHandler<DirectMessagingApi>;
|
||||
messages: WritableSignal<Message[]>;
|
||||
messagesState: WritableSignal<LoadState>;
|
||||
messagesVm: MessagesViewModel;
|
||||
chatData: WritableSignal<Contact>;
|
||||
messageBox: MessageBoxViewModel;
|
||||
wsListener: (action: string, message: string) => void;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<div id="content_tint">
|
||||
@if (router.url.startsWith("/chat/dm") || router.url.startsWith("/chat/picture")) {
|
||||
<!-- To ensure data is loaded -->
|
||||
@defer (when serviceManager.chatsStatus() != LoadStatus.loading) {
|
||||
@defer (when cache.contactsState() != LoadState.CLEAN_LOADING) {
|
||||
<router-outlet />
|
||||
}
|
||||
} @else if (router.url.startsWith("/chat/network")) {
|
||||
|
||||
@@ -16,6 +16,7 @@ import {UserSettings} from './user-settings/user-settings';
|
||||
import {AuthService} from '@chatenium/chatenium-sdk/services/authService';
|
||||
import {UserService} from '@chatenium/chatenium-sdk/services/userService';
|
||||
import { SessionManager } from '../session-manager';
|
||||
import { CacheService, LoadState } from '../cache';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat',
|
||||
@@ -42,10 +43,11 @@ import { SessionManager } from '../session-manager';
|
||||
})
|
||||
export class Chat implements OnInit {
|
||||
sessionManager = inject(SessionManager);
|
||||
serviceManager = inject(ServiceManager)
|
||||
indexedDb = inject(IndexedDB)
|
||||
breakpoint = inject(TUI_BREAKPOINT)
|
||||
router = inject(Router)
|
||||
serviceManager = inject(ServiceManager);
|
||||
cache = inject(CacheService);
|
||||
indexedDb = inject(IndexedDB);
|
||||
breakpoint = inject(TUI_BREAKPOINT);
|
||||
router = inject(Router);
|
||||
|
||||
expandedSidenav = signal(false)
|
||||
|
||||
@@ -86,24 +88,6 @@ export class Chat implements OnInit {
|
||||
this.navigationActiveIndex = 2
|
||||
}
|
||||
|
||||
this.indexedDb.openDatabase().then(async () => {
|
||||
const session = await this.serviceManager.sessionManager.loadPreferredSession()
|
||||
this.serviceManager.currentSession.set(session)
|
||||
this.serviceManager.currentSessionHandler = new UserService(session.userData.userid, session.token, this.indexedDb.getApi())
|
||||
await WebSocketHandler.getInstance().connect(session.userData.userid, session.token)
|
||||
try {
|
||||
console.log("Updating sessions...")
|
||||
const sessions = await this.serviceManager.sessionManager.loadSessions()
|
||||
console.log("Updating sessions: saved sessions loaded...")
|
||||
await this.serviceManager.sessionManager.updateSessions(sessions)
|
||||
const session = await this.serviceManager.sessionManager.loadPreferredSession()
|
||||
console.log("Updating sessions succeeded: updating sessions...")
|
||||
this.serviceManager.currentSession.set(session)
|
||||
} catch (e) {
|
||||
console.warn("Session update failed, skipping...", e)
|
||||
}
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
const latestRead = localStorage.getItem("changeLogLastRead")
|
||||
if (latestRead != environment.version) {
|
||||
@@ -115,4 +99,5 @@ export class Chat implements OnInit {
|
||||
protected readonly LoadStatus = LoadStatus;
|
||||
protected readonly localStorage = localStorage;
|
||||
protected readonly environment = environment;
|
||||
protected readonly LoadState = LoadState;
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ import {Oimg} from '../elements/oimg/oimg';
|
||||
import {Router, RouterLink} from '@angular/router';
|
||||
import {TranslatePipe} from '@ngx-translate/core';
|
||||
import {LoadStatus, ServiceManager} from '../../service-manager';
|
||||
import { Contact, createContactWrapper } from 'chatenium-sdk-preview';
|
||||
import { Contact } from 'chatenium-sdk-preview';
|
||||
import { CHATENIUM_SDK } from '../../chatenium.token';
|
||||
import { Cache, LoadState } from '../../cache';
|
||||
import { CacheService, LoadState } from '../../cache';
|
||||
import { Avatar } from '../elements/avatar/avatar';
|
||||
|
||||
@Component({
|
||||
@@ -21,7 +21,7 @@ export class ContactList implements OnInit {
|
||||
SDK = inject(CHATENIUM_SDK);
|
||||
idb = inject(IndexedDB);
|
||||
router = inject(Router);
|
||||
cache = inject(Cache);
|
||||
cache = inject(CacheService);
|
||||
notification = inject(TuiNotificationService);
|
||||
serviceManager = inject(ServiceManager);
|
||||
breakpoint = inject(TUI_BREAKPOINT);
|
||||
@@ -30,8 +30,12 @@ export class ContactList implements OnInit {
|
||||
if (this.cache.contactsState() != LoadState.LOADED) {
|
||||
try {
|
||||
const contacts = (await this.idb.getAll('contacts')) as Contact[];
|
||||
this.cache.contacts.set(contacts);
|
||||
this.cache.contactsState.set(LoadState.CACHE_UPDATING);
|
||||
if (contacts.length > 0) {
|
||||
this.cache.contacts.set(contacts);
|
||||
this.cache.contactsState.set(LoadState.CACHE_UPDATING);
|
||||
} else {
|
||||
console.log("Found no contacts in cache")
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn(`Contacts cache load failed: ${e}. Skipping cache load...`);
|
||||
}
|
||||
@@ -44,8 +48,8 @@ export class ContactList implements OnInit {
|
||||
return
|
||||
}
|
||||
this.cache.contacts.set(data);
|
||||
this.cache.contactsState.set(LoadState.LOADED);
|
||||
console.log(`Successfully fetched ${data.length} contacts`);
|
||||
this.cache.contactsState.set(LoadState.LOADED);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
this.serviceManager.chatsStatus.set(LoadStatus.error);
|
||||
|
||||
@@ -2,27 +2,29 @@
|
||||
@defer (when store) {
|
||||
<navbar backButtonDest="/chat">
|
||||
<div class="data">
|
||||
<oimg [src]="store.chatData().pfp" height="50px" width="50px" [radius]="15"></oimg>
|
||||
<avatar [src]="this.store.chatData().pfp" height="50px" width="50px" [radius]="15" [name]="this.store.chatData().username"></avatar>
|
||||
<div class="chat-data">
|
||||
@if (store.chatData().displayName == "") {
|
||||
<span class="main-name">{{'@'+store.chatData().username}}</span>
|
||||
@if (this.store.chatData().displayName == "") {
|
||||
<span class="main-name">{{ '@' + this.store.chatData().username }}</span>
|
||||
} @else {
|
||||
<span class="main-name">{{store.chatData().displayName}}</span>
|
||||
<span class="alt-name">{{'@'+store.chatData().username}}</span>
|
||||
<span class="main-name">{{ this.store.chatData().displayName }}</span>
|
||||
<span class="alt-name">{{ '@' + this.store.chatData().username }}</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="items-right">
|
||||
<button tuiButton appearance="flat" disabled>
|
||||
<tui-icon icon="@tui.phone"/>
|
||||
<tui-icon icon="@tui.phone" />
|
||||
</button>
|
||||
</div>
|
||||
</navbar>
|
||||
|
||||
<messages (scrollend)="handleMessagesScroll($event)" [loading]="store.messagesStatus() == LoadStatus.loading" [messageBoxViewModel]="store.messageBox" [messages]="store.messages()" id="scrollContainer" (onDelete)="deleteMessage($event)"/>
|
||||
<messages (scrollend)="handleMessagesScroll($event)" [loading]="store.messagesState() == LoadState.CLEAN_LOADING"
|
||||
[messageBoxViewModel]="store.messageBox" [messages]="store.messages()" id="scrollContainer"
|
||||
(onDelete)="deleteMessage($event)" />
|
||||
|
||||
<message-box [viewModel]="store.messageBox"/>
|
||||
<message-box [viewModel]="store.messageBox" />
|
||||
}
|
||||
|
||||
</main>
|
||||
|
||||
@@ -1,77 +1,88 @@
|
||||
import {Component, inject, OnInit, signal} from '@angular/core';
|
||||
import {DmStorage, LoadStatus, ServiceManager} from '../../service-manager';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
import {DMService} from '@chatenium/chatenium-sdk/services/dmService';
|
||||
import {IndexedDB} from '../../storage/indexed-db';
|
||||
import {Navbar} from '../elements/navbar/navbar';
|
||||
import {Oimg} from '../elements/oimg/oimg';
|
||||
import {TUI_BREAKPOINT, TuiButton, TuiIcon} from '@taiga-ui/core';
|
||||
import {FileDataWithPreview, MessageBox} from '../elements/message-box/message-box';
|
||||
import {Messages} from '../elements/messages/messages';
|
||||
import {Chat} from '@chatenium/chatenium-sdk/domain/chatService.schema';
|
||||
import {Message} from '@chatenium/chatenium-sdk/domain/dmService.schema';
|
||||
import {MessageBoxViewModel} from '../elements/message-box/message-box-viewmodel';
|
||||
import {FileUploadProgressListener} from '@chatenium/chatenium-sdk/domain/fileUploadService.schema';
|
||||
import {Attachment} from '@chatenium/chatenium-sdk/domain/common.schema';
|
||||
import {MessagesViewModel} from '../elements/messages/messages-viewmodel';
|
||||
import {v4 as uuidv4} from 'uuid';
|
||||
import { Component, inject, OnInit, signal } from '@angular/core';
|
||||
import { LoadStatus, ServiceManager } from '../../service-manager';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { IndexedDB } from '../../storage/indexed-db';
|
||||
import { Navbar } from '../elements/navbar/navbar';
|
||||
import { TUI_BREAKPOINT, TuiButton, TuiIcon, TuiNotificationService } from '@taiga-ui/core';
|
||||
import { FileDataWithPreview, MessageBox } from '../elements/message-box/message-box';
|
||||
import { CHATENIUM_SDK } from '../../chatenium.token';
|
||||
import {
|
||||
Contact,
|
||||
createDMWrapper,
|
||||
DirectMessagingApi,
|
||||
Message,
|
||||
WrappedDMHandler,
|
||||
} from 'chatenium-sdk-preview';
|
||||
import { CacheService, DmStorage, LoadState } from '../../cache';
|
||||
import { Avatar } from '../elements/avatar/avatar';
|
||||
import { MessageBoxViewModel } from '../elements/message-box/message-box-viewmodel';
|
||||
import { MessagesViewModel } from '../elements/messages/messages-viewmodel';
|
||||
import { Messages } from '../elements/messages/messages';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dm',
|
||||
imports: [
|
||||
Navbar,
|
||||
Oimg,
|
||||
TuiButton,
|
||||
TuiIcon,
|
||||
MessageBox,
|
||||
Messages
|
||||
],
|
||||
imports: [Navbar, TuiButton, TuiIcon, MessageBox, Avatar, Messages],
|
||||
templateUrl: './dm.html',
|
||||
styleUrl: './dm.scss',
|
||||
})
|
||||
export class Dm implements OnInit {
|
||||
serviceManager = inject(ServiceManager)
|
||||
route = inject(ActivatedRoute)
|
||||
indexedDb = inject(IndexedDB)
|
||||
breakpoint = inject(TUI_BREAKPOINT)
|
||||
SDK = inject(CHATENIUM_SDK);
|
||||
cache = inject(CacheService);
|
||||
serviceManager = inject(ServiceManager);
|
||||
route = inject(ActivatedRoute);
|
||||
notification = inject(TuiNotificationService);
|
||||
indexedDb = inject(IndexedDB);
|
||||
breakpoint = inject(TUI_BREAKPOINT);
|
||||
|
||||
chatid = ""
|
||||
contactId = '';
|
||||
|
||||
get store(): DmStorage {
|
||||
return this.serviceManager.dmServices()[this.chatid]
|
||||
return this.cache.dms()[this.contactId];
|
||||
}
|
||||
|
||||
async sendMessage(message: string, files: FileDataWithPreview[] | null) {
|
||||
if (!files && message.trim() == "") return
|
||||
console.log('sendMessage', message, files);
|
||||
try {
|
||||
const resp = await this.store.handler.sendMessage({
|
||||
content: message,
|
||||
});
|
||||
const data = resp.data as Message;
|
||||
console.log(data);
|
||||
} catch (e) {
|
||||
this.notification.open(`Failed sending DM: ${e}`, { appearance: 'negative' }).subscribe();
|
||||
console.error(e);
|
||||
}
|
||||
/*
|
||||
if (!files && message.trim() == '') return;
|
||||
|
||||
const session = this.serviceManager.currentSession();
|
||||
if (session != null) {
|
||||
const editedMessage = this.store.messageBox.editingMessage()
|
||||
const editedMessage = this.store.messageBox.editingMessage();
|
||||
if (editedMessage) {
|
||||
const storedMsg = this.store.messages().find(m => m.msgid == editedMessage.messageId)
|
||||
const originalMessage: Message = JSON.parse(JSON.stringify(storedMsg))
|
||||
const storedMsg = this.store.messages().find((m) => m.msgid == editedMessage.messageId);
|
||||
const originalMessage: Message = JSON.parse(JSON.stringify(storedMsg));
|
||||
if (storedMsg) {
|
||||
storedMsg.message = message
|
||||
storedMsg.message = message;
|
||||
}
|
||||
|
||||
try {
|
||||
await this.store.service.editMessage(editedMessage.messageId, message)
|
||||
await this.store.service.editMessage(editedMessage.messageId, message);
|
||||
} catch (e) {
|
||||
if (storedMsg) {
|
||||
storedMsg.message = originalMessage.message
|
||||
storedMsg.message = originalMessage.message;
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
let attachments: Attachment[] = []
|
||||
files?.forEach(file => {
|
||||
const extraMetaData: Record<string, any> = {}
|
||||
extraMetaData["thumbnailMetaData"] = file.videoThumbnail ?? ""
|
||||
extraMetaData["progressShown"] = true
|
||||
extraMetaData["totalChunks"] = 0
|
||||
extraMetaData["uploadedChunks"] = 0
|
||||
let attachments: Attachment[] = [];
|
||||
files?.forEach((file) => {
|
||||
const extraMetaData: Record<string, any> = {};
|
||||
extraMetaData['thumbnailMetaData'] = file.videoThumbnail ?? '';
|
||||
extraMetaData['progressShown'] = true;
|
||||
extraMetaData['totalChunks'] = 0;
|
||||
extraMetaData['uploadedChunks'] = 0;
|
||||
|
||||
attachments.push({
|
||||
fileName: file.name,
|
||||
@@ -81,171 +92,200 @@ export class Dm implements OnInit {
|
||||
path: file.blob,
|
||||
height: file.height,
|
||||
width: file.width,
|
||||
extraMetaData: extraMetaData
|
||||
})
|
||||
})
|
||||
extraMetaData: extraMetaData,
|
||||
});
|
||||
});
|
||||
|
||||
const tempMsgId = uuidv4()
|
||||
this.store.messages.update(value => [...value, {
|
||||
message: message,
|
||||
chatid: this.chatid,
|
||||
files: attachments,
|
||||
replyTo: "",
|
||||
author: session.userData.userid,
|
||||
seen: false,
|
||||
msgid: tempMsgId,
|
||||
forwardedFrom: "",
|
||||
isEdited: false,
|
||||
sent_at: {T: 0, I: 0},
|
||||
replyToId: "",
|
||||
forwardedFromName: ""
|
||||
}])
|
||||
const tempMsgId = uuidv4();
|
||||
this.store.messages.update((value) => [
|
||||
...value,
|
||||
{
|
||||
message: message,
|
||||
chatid: this.chatid,
|
||||
files: attachments,
|
||||
replyTo: '',
|
||||
author: session.userData.userid,
|
||||
seen: false,
|
||||
msgid: tempMsgId,
|
||||
forwardedFrom: '',
|
||||
isEdited: false,
|
||||
sent_at: { T: 0, I: 0 },
|
||||
replyToId: '',
|
||||
forwardedFromName: '',
|
||||
},
|
||||
]);
|
||||
|
||||
const respMessage = await this.store.service.sendMessage(tempMsgId, message, null, null, files, <FileUploadProgressListener>{
|
||||
fileProgressUpdate: (tempMsgId, fileId, allChunks, chunksDone) => {
|
||||
this.uploadProgressUpdate(tempMsgId, fileId, allChunks, chunksDone)
|
||||
}
|
||||
})
|
||||
this.updateTempMessage(tempMsgId, respMessage)
|
||||
this.scrollToBottom("smooth")
|
||||
}
|
||||
const respMessage = await this.store.service.sendMessage(
|
||||
tempMsgId,
|
||||
message,
|
||||
null,
|
||||
null,
|
||||
files,
|
||||
<FileUploadProgressListener>{
|
||||
fileProgressUpdate: (tempMsgId, fileId, allChunks, chunksDone) => {
|
||||
this.uploadProgressUpdate(tempMsgId, fileId, allChunks, chunksDone);
|
||||
},
|
||||
},
|
||||
);
|
||||
this.updateTempMessage(tempMsgId, respMessage);
|
||||
this.scrollToBottom('smooth');
|
||||
}*/
|
||||
}
|
||||
|
||||
async deleteMessage(messageId: string) {
|
||||
const i = this.store.messages().findIndex(m => m.msgid == messageId)
|
||||
/*const i = this.store.messages().findIndex((m) => m.msgid == messageId);
|
||||
if (i != -1) {
|
||||
const originalMessage: Message = JSON.parse(JSON.stringify(this.store.messages()[i]))
|
||||
this.store.messages().splice(i, 1)
|
||||
const originalMessage: Message = JSON.parse(JSON.stringify(this.store.messages()[i]));
|
||||
this.store.messages().splice(i, 1);
|
||||
try {
|
||||
await this.store.service.deleteMessages([messageId])
|
||||
await this.store.service.deleteMessages([messageId]);
|
||||
} catch (e) {
|
||||
this.store.messages().splice(i, 0, originalMessage)
|
||||
this.store.messages().splice(i, 0, originalMessage);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
async loadMessages() {
|
||||
try {
|
||||
const resp = await this.store.handler.getMessages(0);
|
||||
const data = resp.data as Message[];
|
||||
console.log(
|
||||
`Successfully fetched ${data.length} message(s) in DM ${this.store.chatData().contactId}`,
|
||||
);
|
||||
console.log(data);
|
||||
this.store.messages.set(data);
|
||||
this.store.messagesState.set(LoadState.LOADED);
|
||||
} catch (e) {
|
||||
this.notification
|
||||
.open('Loading direct messages failed.', { appearance: 'negative' })
|
||||
.subscribe();
|
||||
}
|
||||
}
|
||||
|
||||
restoreScrollState(): void {
|
||||
setTimeout(() => {
|
||||
const scrollContainer = <HTMLDivElement>document.querySelector("#scrollContainer")
|
||||
const scrollContainer = <HTMLDivElement>document.querySelector('#scrollContainer');
|
||||
scrollContainer.scroll({
|
||||
top: this.store.messagesVm.scrollBarStatus() == -1 ? scrollContainer.scrollHeight : this.store.messagesVm.scrollBarStatus(),
|
||||
top:
|
||||
this.store.messagesVm.scrollBarStatus() == -1
|
||||
? scrollContainer.scrollHeight
|
||||
: this.store.messagesVm.scrollBarStatus(),
|
||||
left: 0,
|
||||
behavior: "instant"
|
||||
behavior: 'instant',
|
||||
});
|
||||
|
||||
if (this.store.messagesVm.scrollBarStatus() == -1) {
|
||||
this.store.messagesVm.scrollBarStatus.set(scrollContainer.scrollHeight)
|
||||
this.store.messagesVm.scrollBarStatus.set(scrollContainer.scrollHeight);
|
||||
}
|
||||
}, 0)
|
||||
}, 0);
|
||||
}
|
||||
|
||||
scrollToBottom(anim: 'instant' | 'smooth'): void {
|
||||
setTimeout(() => {
|
||||
const scrollContainer = <HTMLDivElement>document.querySelector("#scrollContainer")
|
||||
const scrollContainer = <HTMLDivElement>document.querySelector('#scrollContainer');
|
||||
scrollContainer.scroll({
|
||||
top: scrollContainer.scrollHeight,
|
||||
left: 0,
|
||||
behavior: anim
|
||||
behavior: anim,
|
||||
});
|
||||
}, 0)
|
||||
}, 0);
|
||||
}
|
||||
|
||||
handleMessagesScroll(e: any) {
|
||||
this.store.messagesVm.scrollBarStatus.set(e.target.scrollTop)
|
||||
this.store.messagesVm.scrollBarStatus.set(e.target.scrollTop);
|
||||
}
|
||||
|
||||
uploadProgressUpdate(tempMsgId: string, fileId: string, allChunks: number, chunksDone: number) {
|
||||
console.log(tempMsgId, fileId, allChunks, chunksDone)
|
||||
this.store.messages.update(messages =>
|
||||
messages.map(m => {
|
||||
/*
|
||||
console.log(tempMsgId, fileId, allChunks, chunksDone);
|
||||
this.store.messages.update((messages) =>
|
||||
messages.map((m) => {
|
||||
if (m.msgid !== tempMsgId) return m;
|
||||
|
||||
return {
|
||||
...m,
|
||||
files: m.files.map(f => {
|
||||
files: m.files.map((f) => {
|
||||
if (f.fileId !== fileId) return f;
|
||||
return {
|
||||
...f,
|
||||
extraMetaData: {
|
||||
...f.extraMetaData,
|
||||
totalChunks: allChunks,
|
||||
uploadedChunks: chunksDone
|
||||
}
|
||||
uploadedChunks: chunksDone,
|
||||
},
|
||||
};
|
||||
})
|
||||
}),
|
||||
};
|
||||
})
|
||||
);
|
||||
}),
|
||||
);*/
|
||||
}
|
||||
|
||||
updateTempMessage(tempMsgId: string, message: Message) {
|
||||
this.store.messages.update(messages =>
|
||||
messages.map(m => {
|
||||
/*
|
||||
this.store.messages.update((messages) =>
|
||||
messages.map((m) => {
|
||||
if (m.msgid !== tempMsgId) return m;
|
||||
|
||||
return {
|
||||
...m,
|
||||
msgid: message.msgid,
|
||||
sent_at: message.sent_at,
|
||||
files: m.files.map(f => {
|
||||
f.extraMetaData["progressShown"] = false
|
||||
return f
|
||||
})
|
||||
files: m.files.map((f) => {
|
||||
f.extraMetaData['progressShown'] = false;
|
||||
return f;
|
||||
}),
|
||||
};
|
||||
})
|
||||
);
|
||||
}),
|
||||
);*/
|
||||
}
|
||||
|
||||
// The chatid parameter ensures isolation
|
||||
onWsListen(action: string, message: string, chatid: string) {
|
||||
/*
|
||||
const data = JSON.parse(message);
|
||||
if (data.chatid === chatid) {
|
||||
const targetStore = this.serviceManager.dmServices()[chatid];
|
||||
if (targetStore) {
|
||||
switch (action) {
|
||||
case "newMessage":
|
||||
targetStore.messages.update(messages => [...messages, data]);
|
||||
this.scrollToBottom("smooth")
|
||||
case 'newMessage':
|
||||
targetStore.messages.update((messages) => [...messages, data]);
|
||||
this.scrollToBottom('smooth');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.params.subscribe(async params => {
|
||||
const chatid = params['chatid'];
|
||||
this.chatid = chatid;
|
||||
console.log(`Loading chat ${chatid}...`)
|
||||
this.route.params.subscribe(async (params) => {
|
||||
const contactId = params['contactId'];
|
||||
this.contactId = contactId;
|
||||
console.log(`Loading DM chat ${contactId}...`);
|
||||
|
||||
const session = this.serviceManager.currentSession();
|
||||
const chatData = this.serviceManager.chats().find(c => c.chatid === chatid);
|
||||
const chatData = this.cache.contacts().find((c) => c.contactId === contactId);
|
||||
|
||||
if (!session || !chatData) {
|
||||
return
|
||||
if (!chatData) {
|
||||
console.warn(
|
||||
`Unable to find chat data with the provided contactId: ${contactId}, skipping load.`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.serviceManager.dmServices()[chatid]) {
|
||||
const newStore = {
|
||||
chatData: signal<Chat>(chatData),
|
||||
if (!this.cache.dms()[contactId]) {
|
||||
console.log(`No store yet, creating service store for DM: ${contactId}`);
|
||||
this.cache.dms()[contactId] = {
|
||||
handler: createDMWrapper(this.SDK.directMessaging, chatData.contactId),
|
||||
chatData: signal<Contact>(chatData),
|
||||
messages: signal<Message[]>([]),
|
||||
messagesStatus: signal<LoadStatus>(LoadStatus.loading),
|
||||
messagesState: signal<LoadState>(LoadState.CLEAN_LOADING),
|
||||
messageBox: new MessageBoxViewModel((msg, files) => this.sendMessage(msg, files)),
|
||||
messagesVm: new MessagesViewModel(),
|
||||
wsListener: (action, data) => this.onWsListen(action, data, chatid),
|
||||
wsListener: (action, data) => this.onWsListen(action, data, contactId),
|
||||
} as DmStorage;
|
||||
|
||||
newStore.service = new DMService(
|
||||
session.userData.userid,
|
||||
session.token,
|
||||
chatid,
|
||||
this.indexedDb.getApi(),
|
||||
(action, data) => newStore.wsListener(action, data)
|
||||
);
|
||||
|
||||
this.serviceManager.dmServices()[chatid] = newStore;
|
||||
|
||||
const currentStore = this.serviceManager.dmServices()[chatid];
|
||||
await this.loadMessages();
|
||||
/*
|
||||
const currentStore = this.serviceManager.dmServices()[contactId];
|
||||
try {
|
||||
const messagesCache = await currentStore.service.getQuick();
|
||||
currentStore.messages.set(messagesCache);
|
||||
@@ -262,9 +302,12 @@ export class Dm implements OnInit {
|
||||
await currentStore.service.joinWebSocketRoom();
|
||||
} else {
|
||||
this.restoreScrollState()
|
||||
}*/
|
||||
}
|
||||
console.log(`Finished initializing chat: ${contactId}`);
|
||||
});
|
||||
}
|
||||
|
||||
protected readonly LoadStatus = LoadStatus;
|
||||
protected readonly LoadState = LoadState;
|
||||
}
|
||||
|
||||
@@ -12,5 +12,5 @@ export class MessageBoxViewModel {
|
||||
message = signal<string>("")
|
||||
files = signal<FileDataWithPreview[]>([])
|
||||
dialogOpen = signal<boolean>(false)
|
||||
editingMessage = signal<{messageId: string, message: string} | null >(null)
|
||||
editingMessage = signal<{messageId: string, content: string|undefined} | null >(null)
|
||||
}
|
||||
|
||||
@@ -55,11 +55,11 @@
|
||||
@if (viewModel().editingMessage()) {
|
||||
<tui-icon icon="@tui.pencil"></tui-icon>
|
||||
<span>{{"chat.elements.messageBox.editMessageLabel"|translate}}</span>
|
||||
@if (viewModel().editingMessage()!.message == "") {
|
||||
@if (viewModel().editingMessage()!.content == "") {
|
||||
<tui-icon icon="@tui.paperclip"></tui-icon>
|
||||
<span>{{"chat.elements.messageBox.attachments"|translate}}</span>
|
||||
} @else {
|
||||
<span style="width: 300px" tuiScrollable tuiFade>{{viewModel().editingMessage()!.message}}</span>
|
||||
<span style="width: 300px" tuiScrollable tuiFade>{{viewModel().editingMessage()!.content}}</span>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -13,24 +13,24 @@
|
||||
}
|
||||
} @else {
|
||||
@if (serviceManager.currentSession != null) {
|
||||
@for (message of messages(); track message.msgid; let i = $index) {
|
||||
@for (message of messages(); track message.messageId; let i = $index) {
|
||||
<div
|
||||
class="message"
|
||||
[class.author]="
|
||||
messageAsDm(message).author == serviceManager.currentSession()!.userData.userid ||
|
||||
messageAsNetwork(message).author.userid == serviceManager.currentSession()!.userData.userid
|
||||
messageAsDm(message).author.userId == sessionManager.userData()?.userId ||
|
||||
messageAsNetwork(message).author.userId == sessionManager.userData()?.userId
|
||||
"
|
||||
[class.chained_start]="isMessageStartOfChain(i)"
|
||||
[class.chained_middle]="isMessageMiddleInChain(i)"
|
||||
[class.chained_end]="isMessageEndOfChain(i)"
|
||||
>
|
||||
<div class="above">
|
||||
<span>{{ message.sent_at.T * 1000 | date: 'HH:mm' }}</span>
|
||||
<span>{{ message.sentAt | date: 'HH:mm' }}</span>
|
||||
</div>
|
||||
<div class="bubble" tuiDropdownContext [tuiDropdown]="messageContextMenu">
|
||||
<span class="message-text">{{ message.message }}</span>
|
||||
<masonry style="max-height: 300px">
|
||||
@for (file of filterExpressedMedia(message.files); track file) {
|
||||
<span class="message-text">{{ message.content }}</span>
|
||||
<!-- <masonry style="max-height: 300px">
|
||||
@for (file of filterExpressedMedia(message.attachments); track file) {
|
||||
<div style="position:relative;">
|
||||
@if (file.extraMetaData && Object.keys(file.extraMetaData).length > 0) {
|
||||
@if (file.extraMetaData['progressShown']) {
|
||||
@@ -75,7 +75,7 @@
|
||||
<span>{{ file.fileName }}</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
<div class="below"></div>
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
tuiOption
|
||||
type="button"
|
||||
iconEnd="@tui.pencil"
|
||||
(click)="messageBoxViewModel().editingMessage.set({message: message.message, messageId: message.msgid}); messageBoxViewModel().message.set(message.message);"
|
||||
(click)="messageBoxViewModel().editingMessage.set({content: message.content, messageId: message.messageId}); messageBoxViewModel().message.set(message.content??'');"
|
||||
>
|
||||
{{ "chat.elements.messages.contextMenu.edit" | translate }}
|
||||
</button>
|
||||
@@ -95,7 +95,7 @@
|
||||
tuiOption
|
||||
type="button"
|
||||
iconEnd="@tui.trash"
|
||||
(click)="onDelete.emit(message.msgid)"
|
||||
(click)="onDelete.emit(message.messageId)"
|
||||
>
|
||||
{{ "chat.elements.messages.contextMenu.delete" | translate }}
|
||||
</button>
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import {Component, EventEmitter, inject, input, Output} from '@angular/core';
|
||||
import {Message} from '@chatenium/chatenium-sdk/domain/dmService.schema';
|
||||
import {Message as NetworkMessage} from '@chatenium/chatenium-sdk/domain/textChannelService.schema'
|
||||
import {ServiceManager} from '../../../service-manager';
|
||||
import {DatePipe} from '@angular/common';
|
||||
import {Masonry} from '../masonry/masonry';
|
||||
import {VideoPlayer} from '../video-player/video-player';
|
||||
import { Component, EventEmitter, inject, input, Output } from '@angular/core';
|
||||
import { Message, ThreadMessage, Attachment, ThreadMessageAttachment } from 'chatenium-sdk-preview';
|
||||
import { ServiceManager } from '../../../service-manager';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Masonry } from '../masonry/masonry';
|
||||
import { VideoPlayer } from '../video-player/video-player';
|
||||
import {
|
||||
TuiButton,
|
||||
TuiDataListComponent,
|
||||
@@ -12,13 +11,12 @@ import {
|
||||
TuiDropdownContext,
|
||||
TuiGroup,
|
||||
TuiIcon,
|
||||
TuiOption
|
||||
TuiOption,
|
||||
} from '@taiga-ui/core';
|
||||
import {TranslatePipe} from '@ngx-translate/core';
|
||||
import {MessageBoxViewModel} from '../message-box/message-box-viewmodel';
|
||||
import {FileDataWithPreview} from '../message-box/message-box';
|
||||
import {Attachment} from '@chatenium/chatenium-sdk/domain/common.schema';
|
||||
import {TuiProgressCircle, TuiSkeleton} from '@taiga-ui/kit';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import { MessageBoxViewModel } from '../message-box/message-box-viewmodel';
|
||||
import { TuiProgressCircle, TuiSkeleton } from '@taiga-ui/kit';
|
||||
import { SessionManager } from '../../../session-manager';
|
||||
|
||||
@Component({
|
||||
selector: 'messages',
|
||||
@@ -35,27 +33,28 @@ import {TuiProgressCircle, TuiSkeleton} from '@taiga-ui/kit';
|
||||
TuiGroup,
|
||||
TuiIcon,
|
||||
TuiProgressCircle,
|
||||
TuiSkeleton
|
||||
TuiSkeleton,
|
||||
],
|
||||
templateUrl: './messages.html',
|
||||
styleUrl: './messages.scss',
|
||||
})
|
||||
export class Messages {
|
||||
serviceManager = inject(ServiceManager)
|
||||
serviceManager = inject(ServiceManager);
|
||||
sessionManager = inject(SessionManager);
|
||||
|
||||
messages = input.required<Message[] | NetworkMessage[]>()
|
||||
messageBoxViewModel = input.required<MessageBoxViewModel>()
|
||||
loading = input(false)
|
||||
messages = input.required<Message[] | ThreadMessage[]>();
|
||||
messageBoxViewModel = input.required<MessageBoxViewModel>();
|
||||
loading = input(false);
|
||||
|
||||
@Output() onDelete = new EventEmitter<string>()
|
||||
@Output() onDelete = new EventEmitter<string>();
|
||||
|
||||
/**
|
||||
* Helps code readability by specifying what type of messages are being processed.
|
||||
* Example: messageAsDm(message).author == userid -- We are specifying that we are handling dm messages
|
||||
* @param message
|
||||
*/
|
||||
messageAsDm(message: Message | NetworkMessage) {
|
||||
return message == undefined ? <Message>{author: "no"} : message as Message
|
||||
messageAsDm(message: Message | ThreadMessage) {
|
||||
return message as Message;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,8 +62,8 @@ export class Messages {
|
||||
Example: messageAsNetwork(message).author.userid == userid -- We are specifying that we are handling network messages
|
||||
* @param message
|
||||
*/
|
||||
messageAsNetwork(message: Message | NetworkMessage) {
|
||||
return message == undefined ? <NetworkMessage>{author: {userid: "no"}} : message as NetworkMessage
|
||||
messageAsNetwork(message: Message | ThreadMessage) {
|
||||
return message as ThreadMessage;
|
||||
}
|
||||
|
||||
isMessageStartOfChain(i: number) {
|
||||
@@ -76,16 +75,17 @@ export class Messages {
|
||||
// is author == last msg's author
|
||||
if (prev) {
|
||||
if (
|
||||
(typeof message.author === 'string' && this.messageAsDm(prev).author !== this.messageAsDm(message).author) &&
|
||||
this.messageAsNetwork(prev).author.userid !== this.messageAsNetwork(message).author.userid
|
||||
typeof message.author === 'string' &&
|
||||
this.messageAsDm(prev).author.userId !== this.messageAsDm(message).author.userId &&
|
||||
this.messageAsNetwork(prev).author.userId !== this.messageAsNetwork(message).author.userId
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// same author but time gap between this and prev msg
|
||||
if (
|
||||
Math.abs(message.sent_at.T - prev.sent_at.T) >= 60
|
||||
) {
|
||||
const currMsgDate = new Date(message.sentAt);
|
||||
const prevMsgDate = new Date(prev.sentAt);
|
||||
if (Math.abs(currMsgDate.getDate() - prevMsgDate.getDate()) >= 60_000) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -100,12 +100,14 @@ export class Messages {
|
||||
const prev = this.messages()[i - 1];
|
||||
|
||||
// message must be from the same author and have little time gap between
|
||||
const currMsgDate = new Date(message.sentAt);
|
||||
const prevMsgDate = new Date(prev.sentAt);
|
||||
return (
|
||||
(
|
||||
(typeof message.author === 'string' && this.messageAsDm(prev).author == this.messageAsDm(message).author) ||
|
||||
this.messageAsNetwork(prev).author.userid == this.messageAsNetwork(message).author.userid
|
||||
) &&
|
||||
Math.abs(message.sent_at.T - prev.sent_at.T) <= 60
|
||||
((typeof message.author === 'string' &&
|
||||
this.messageAsDm(prev).author == this.messageAsDm(message).author) ||
|
||||
this.messageAsNetwork(prev).author.userId ==
|
||||
this.messageAsNetwork(message).author.userId) &&
|
||||
Math.abs(currMsgDate.getDate() - prevMsgDate.getDate()) <= 60_000
|
||||
);
|
||||
}
|
||||
|
||||
@@ -118,19 +120,20 @@ export class Messages {
|
||||
|
||||
const next = this.messages()[i + 1];
|
||||
|
||||
const currMsgDate = new Date(message.sentAt);
|
||||
const nextMsgDate = new Date(next.sentAt);
|
||||
// First condition: next author is different
|
||||
if (next) {
|
||||
if (
|
||||
(typeof message.author === 'string' && this.messageAsDm(next).author != this.messageAsDm(message).author) ||
|
||||
this.messageAsNetwork(next).author.userid != this.messageAsNetwork(message).author.userid
|
||||
(typeof message.author === 'string' &&
|
||||
this.messageAsDm(next).author != this.messageAsDm(message).author) ||
|
||||
this.messageAsNetwork(next).author.userId != this.messageAsNetwork(message).author.userId
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// same author but time gap between this and next msg
|
||||
if (
|
||||
Math.abs(message.sent_at.T - next.sent_at.T) >= 60
|
||||
) {
|
||||
if (Math.abs(currMsgDate.getDate() - nextMsgDate.getDate()) >= 60) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -139,12 +142,16 @@ export class Messages {
|
||||
return i + 1 === this.messages().length;
|
||||
}
|
||||
|
||||
filterExpressedMedia(files: Attachment[]) {
|
||||
return files.filter(f => f.type == "image" || f.type == "video")
|
||||
filterExpressedMedia(files: Attachment[] | ThreadMessageAttachment[] | undefined) {
|
||||
return files
|
||||
? files.filter((f) => f.mimeType.startsWith('image') || f.mimeType.startsWith('video'))
|
||||
: [];
|
||||
}
|
||||
|
||||
filterNonExpressedMedia(files: Attachment[]) {
|
||||
return files.filter(f => f.type != "image" && f.type != "video")
|
||||
filterNonExpressedMedia(files: Attachment[] | ThreadMessageAttachment[] | undefined) {
|
||||
return files
|
||||
? files.filter((f) => f.mimeType.startsWith('image') || f.mimeType.startsWith('video'))
|
||||
: [];
|
||||
}
|
||||
|
||||
protected readonly Object = Object;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Component, inject, signal} from '@angular/core';
|
||||
import {DmStorage, LoadStatus, ServiceManager, TextChannelStorage} from '../../../../service-manager';
|
||||
import {LoadStatus, ServiceManager, TextChannelStorage} from '../../../../service-manager';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
import {IndexedDB} from '../../../../storage/indexed-db';
|
||||
import {TUI_BREAKPOINT, TuiButton, TuiIcon} from '@taiga-ui/core';
|
||||
|
||||
@@ -3,7 +3,7 @@ import {ActivatedRoute, Router, RouterLink, RouterOutlet} from '@angular/router'
|
||||
import {Chat} from '@chatenium/chatenium-sdk/domain/chatService.schema';
|
||||
import {Message} from '@chatenium/chatenium-sdk/domain/dmService.schema';
|
||||
import {MessageBoxViewModel} from '../elements/message-box/message-box-viewmodel';
|
||||
import {DmStorage, NetworkStorage, ServiceManager} from '../../service-manager';
|
||||
import {NetworkStorage, ServiceManager} from '../../service-manager';
|
||||
import {DMService} from '@chatenium/chatenium-sdk/services/dmService';
|
||||
import {Network as NetworkData} from "@chatenium/chatenium-sdk/domain/networkService.schema"
|
||||
import {NetworkService} from '@chatenium/chatenium-sdk/services/networkService';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Component, inject, signal} from '@angular/core';
|
||||
import {DmStorage, PictureStorage, ServiceManager} from '../../../service-manager';
|
||||
import {PictureStorage, ServiceManager} from '../../../service-manager';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {IndexedDB} from '../../../storage/indexed-db';
|
||||
import {TUI_BREAKPOINT, TuiButton, TuiDialog, TuiIcon} from '@taiga-ui/core';
|
||||
|
||||
@@ -42,7 +42,7 @@ export class ServiceManager {
|
||||
// Services for individual networks
|
||||
networkServices = signal<Record<string, NetworkStorage>>({})
|
||||
|
||||
dmServices = signal<Record<string, DmStorage>>({})
|
||||
//dmServices = signal<Record<string, DmStorage>>({})
|
||||
pictureServices = signal<Record<string, PictureStorage>>({})
|
||||
}
|
||||
|
||||
@@ -53,16 +53,6 @@ export enum LoadStatus {
|
||||
updating = 3,
|
||||
}
|
||||
|
||||
export interface DmStorage {
|
||||
service: DMService
|
||||
messages: WritableSignal<Message[]>
|
||||
messagesStatus: WritableSignal<LoadStatus>
|
||||
messagesVm: MessagesViewModel
|
||||
chatData: WritableSignal<Chat>
|
||||
messageBox: MessageBoxViewModel
|
||||
wsListener: (action: string, message: string) => void
|
||||
}
|
||||
|
||||
export interface PictureStorage {
|
||||
service: PictureService
|
||||
albums: WritableSignal<Album[]>
|
||||
|
||||
@@ -91,7 +91,6 @@ export class SessionManager {
|
||||
console.log(
|
||||
`Successfully rotated token pair for ID: ${userData.userId} Username: ${userData.username}. This session is now ready to be used.`,
|
||||
);
|
||||
console.log(data.accessToken)
|
||||
this.sessionReady.set(true);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
||||
Reference in New Issue
Block a user