fix chat delete message

This commit is contained in:
Peter Maquiran
2023-01-18 14:40:12 +01:00
parent b890b58a86
commit 16de340501
6 changed files with 19 additions and 17 deletions
+2 -1
View File
@@ -76,4 +76,5 @@ _android/
_www/ _www/
www2020 www2020
android copy/ android copy/
report.* report.*
src/plugin/src/
-6
View File
@@ -115,7 +115,6 @@ export class ChatPage implements OnInit {
public ChatSystemService: ChatSystemService, public ChatSystemService: ChatSystemService,
) { ) {
this.loggedUserChat = SessionStore.user.ChatData?.data;
this.headers = new HttpHeaders(); this.headers = new HttpHeaders();
window.onresize = (event) => { window.onresize = (event) => {
if (window.innerWidth > 701) { if (window.innerWidth > 701) {
@@ -591,11 +590,8 @@ export class ChatPage implements OnInit {
return dateB - dateA; return dateB - dateA;
}); });
// //
}) })
} }
} }
@@ -617,7 +613,6 @@ export class ChatPage implements OnInit {
_updatedAt: element._updatedAt _updatedAt: element._updatedAt
} }
groupsArray.push(roomList) groupsArray.push(roomList)
}); });
@@ -636,7 +631,6 @@ export class ChatPage implements OnInit {
updatedat: element._updatedAt updatedat: element._updatedAt
} }
this.sqlservice.addChatListRoom(roomList); this.sqlservice.addChatListRoom(roomList);
}); });
} }
+4 -2
View File
@@ -446,9 +446,11 @@ export class MessageService {
async delateDB() { async delateDB() {
const message = await MessageModel.get({id: this.id}) if(!this.rowInstance) {
await message.delete() this.rowInstance = await this.getRowInstance()
}
await this.rowInstance.delete()
} }
+7 -1
View File
@@ -452,7 +452,13 @@ export class RoomService {
"stream-notify-room", "stream-notify-room",
async (ChatMessage) => { async (ChatMessage) => {
const DeletedMessageId = ChatMessage.fields.args[0]._id; const DeletedMessageId = ChatMessage.fields.args[0]._id;
this.deleteMessage(DeletedMessageId)
const message = this.messages.find((e) => e._id == DeletedMessageId)
if(message.delate == false) {
this.deleteMessage(DeletedMessageId)
}
} }
) )
} }
-1
View File
@@ -4,7 +4,6 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Observable, from } from 'rxjs'; import { Observable, from } from 'rxjs';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service'; import { AuthService } from '../services/auth.service';
import { UserSession } from '../models/user.model';
import { EventList } from '../models/agenda/AgendaEventList'; import { EventList } from '../models/agenda/AgendaEventList';
import { ChangeProfileService } from './change-profile.service'; import { ChangeProfileService } from './change-profile.service';
import { OfflineManagerService } from 'src/app/services/offline-manager.service'; import { OfflineManagerService } from 'src/app/services/offline-manager.service';
+6 -6
View File
@@ -1,12 +1,12 @@
export let versionData = { export let versionData = {
"shortSHA": "46296813b", "shortSHA": "b890b58a8",
"SHA": "46296813b849aad1f6037fa09577a2ba04f4d2ca", "SHA": "b890b58a86e4c459836236774015a1bc38ee0b1c",
"branch": "no_bug_movemente", "branch": "no_bug_movemente",
"lastCommitAuthor": "'Peter Maquiran'", "lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Wed Jan 18 11:38:21 2023 +0100'", "lastCommitTime": "'Wed Jan 18 11:59:53 2023 +0100'",
"lastCommitMessage": "clear agenda cache", "lastCommitMessage": "fix",
"lastCommitNumber": "4651", "lastCommitNumber": "4652",
"change": "", "change": "",
"changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/services/attachments.service.ts\n\tmodified: src/app/services/auth.service.ts\n\tmodified: src/app/services/contacts.service.ts\n\tmodified: src/app/services/events.service.ts\n\tmodified: src/app/services/organic-entity.service.ts\n\tmodified: src/app/services/publications.service.ts\n\tmodified: src/app/services/search.service.ts", "changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: .gitignore\n\tmodified: src/app/pages/chat/chat.page.ts\n\tmodified: src/app/services/chat/message.service.ts\n\tmodified: src/app/services/chat/room.service.ts\n\tmodified: src/app/services/events.service.ts",
"changeAuthor": "peter.maquiran" "changeAuthor": "peter.maquiran"
} }