This commit is contained in:
Peter Maquiran
2023-01-12 15:27:09 +01:00
parent 58f9e7eacd
commit 9493179efd
82 changed files with 702 additions and 557 deletions
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { ChangeMessageQueueService } from './change-message-queue.service';
describe('ChangeMessageQueueService', () => {
let service: ChangeMessageQueueService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ChangeMessageQueueService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,8 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class ChangeMessageQueueService {
constructor() {}
}
+11 -6
View File
@@ -504,20 +504,25 @@ export class MessageService {
const message = this.getChatObj()
let a
if(!message.id) {
delete message.id
}
if (this.localReference) {
a = await MessageModel.get({localReference: this.localReference})
} else if (this._id) {
a = await MessageModel.get({id: this.id})
} else if(this.id) {
a = await MessageModel.get({_id: this._id})
} else if(this.id) {
a = await MessageModel.get({id: this.id})
}
for( const [name, value] of Object.entries(message)) {
a[name] = value
if(a) {
for( const [name, value] of Object.entries(message)) {
a[name] = value
}
await a.save()
}
await a.save()
} else {
this.earlySave = true
console.log('save change to early')
-2
View File
@@ -763,8 +763,6 @@ export class RoomService {
}
async readAllMessage() {
this.ViewedMessageService.requestReadAll(this)
@@ -1,6 +1,5 @@
import { Injectable } from '@angular/core';
import * as FIFOProcessQueue from 'fifo-process-queue';
import { async } from 'rxjs';
import { RoomService } from './room.service';
@Injectable({