mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
save all
This commit is contained in:
@@ -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() {}
|
||||
}
|
||||
@@ -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')
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user