mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fix image one shot
This commit is contained in:
@@ -426,6 +426,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
async viewOnce(event: Event, message: MessageViewModal, index:number) {
|
||||
const params: ViewOncesImagePageInput = {
|
||||
imageDataUrl: message.attachments[index].safeFile as any,
|
||||
messageId: message.id,
|
||||
roomId: this.room.id,
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewOncesImagePage,
|
||||
@@ -456,14 +458,14 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
if(!me) {
|
||||
|
||||
//if(message.oneShot == false) {
|
||||
if(message.oneShot == false) {
|
||||
this.chatServiceService.sendReadAt({
|
||||
memberId: SessionStore.user.UserId,
|
||||
messageId: message.id,
|
||||
requestId: uuidv4(),
|
||||
roomId: this.room.id
|
||||
})
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -502,14 +504,14 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
}
|
||||
}
|
||||
|
||||
//if(message.oneShot == false) {
|
||||
if(message.oneShot == false) {
|
||||
this.chatServiceService.sendReadAt({
|
||||
memberId: SessionStore.user.UserId,
|
||||
messageId: message.id,
|
||||
requestId: '',
|
||||
roomId: this.room.id
|
||||
})
|
||||
//}
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
this.scrollToBottomClicked()
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { NavParams, ModalController } from '@ionic/angular';
|
||||
import { ChatServiceService } from 'src/app/module/chat/domain/chat-service.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { z } from 'zod';
|
||||
|
||||
|
||||
const ViewOncesImagePageInputSchema = z.object({
|
||||
// messageId: z.string(),
|
||||
messageId: z.string(),
|
||||
roomId: z.string(),
|
||||
// attachmentIndex: z.number(),
|
||||
imageDataUrl: z.string()
|
||||
})
|
||||
@@ -24,6 +27,7 @@ export class ViewOncesImagePage implements OnInit {
|
||||
constructor(
|
||||
private navParams: NavParams,
|
||||
public modalController: ModalController,
|
||||
private chatServiceService: ChatServiceService,
|
||||
) {
|
||||
this.params = this.navParams.data
|
||||
|
||||
@@ -35,6 +39,18 @@ export class ViewOncesImagePage implements OnInit {
|
||||
} else {
|
||||
this.blobURl = false
|
||||
}
|
||||
|
||||
this.sendReadMessage();
|
||||
}
|
||||
|
||||
|
||||
sendReadMessage() {
|
||||
this.chatServiceService.sendReadAt({
|
||||
memberId: SessionStore.user.UserId,
|
||||
messageId: this.params.messageId,
|
||||
requestId: '',
|
||||
roomId: this.params.roomId
|
||||
})
|
||||
}
|
||||
|
||||
closePage() {
|
||||
|
||||
@@ -10,7 +10,6 @@ import { IDBoolean } from 'src/app/infra/database/dexie/type';
|
||||
import { ChatServiceService } from 'src/app/module/chat/domain/chat-service.service';
|
||||
import { MessageAttachmentSource, MessageEntitySchema } from 'src/app/core/chat/entity/message';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { Logger } from 'src/app/services/logger/main/service';
|
||||
import { Observable as DexieObservable } from 'Dexie';
|
||||
import { tap } from 'rxjs/operators';
|
||||
import { MemberTable } from 'src/app/infra/database/dexie/instance/chat/schema/members';
|
||||
@@ -224,14 +223,14 @@ export class RoomStore {
|
||||
}
|
||||
}
|
||||
|
||||
//if(message.oneShot == false) {
|
||||
if(message.oneShot == false) {
|
||||
this.chatServiceService.sendReadAt({
|
||||
memberId: SessionStore.user.UserId,
|
||||
messageId: message.id,
|
||||
requestId: uuidv4(),
|
||||
roomId: this.room.id
|
||||
})
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
@@ -351,14 +350,14 @@ export class RoomStore {
|
||||
if(!me) {
|
||||
// Logger.info('send read at, sender '+ message.sender.wxFullName+ ' '+ message.message +'message id'+ message.id)
|
||||
|
||||
//if(message.oneShot == false) {
|
||||
if(message.oneShot == false) {
|
||||
this.chatServiceService.sendReadAt({
|
||||
memberId: SessionStore.user.UserId,
|
||||
messageId: message.id,
|
||||
requestId: uuidv4(),
|
||||
roomId: this.room.id
|
||||
})
|
||||
//}
|
||||
}
|
||||
|
||||
} else {
|
||||
// console.log('no need', message )
|
||||
|
||||
Reference in New Issue
Block a user