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