This commit is contained in:
Peter Maquiran
2022-02-04 08:11:49 +01:00
parent 80aaf352b6
commit 91ed23cb3a
4 changed files with 18 additions and 150 deletions
-5
View File
@@ -159,11 +159,6 @@ export class ChatPage implements OnInit {
let t = this.showDateDuration(new Date());
this.setStatus('away');
/* if(this.dataService.get("newGroup")){
this.openNewGroupPage();
} */
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith('/home/chat')) {
if (this.dataService.get("newGroup")) {
+5 -44
View File
@@ -596,11 +596,12 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
await modal.present();
modal.onDidDismiss().then(async res=>{
const data = res.data;
const roomId = this.roomId
if(data.selected) {
const loader = this.toastService.loading();
const { message, updateMessage} = this.wsChatMethodsService.getDmRoom(this.roomId).send({
const { message, updateMessage} = this.wsChatMethodsService.getDmRoom(roomId).send({
file:{
"name": res.data.selected.Assunto,
"type": "application/webtrix",
@@ -646,13 +647,15 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
async addFileToChat(types: typeof FileType[] ) {
const roomId = this.roomId
const file = await this.fileService.getFileFromDevice(types);
const imageData = await this.fileToBase64Service.convert(file)
const formData = new FormData();
formData.append("blobFile", file);
const { message, updateMessage} = this.wsChatMethodsService.getDmRoom(this.roomId).send({
const { message, updateMessage} = this.wsChatMethodsService.getDmRoom(roomId).send({
file: {
"type": "application/img",
"guid": '',
@@ -807,48 +810,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
sliderOpts = {
zoom: false,
slidesPerView: 1.5,
spaceBetween: 20,
centeredSlides: true
};
zoomActive = false;
zoomScale = 1;
sliderZoomOpts = {
allowSlidePrev: false,
allowSlideNext: false,
zoom: {
maxRatio: 5
},
on: {
zoomChange: (scale, imageEl, slideEl) => {
this.zoomActive = true;
this.zoomScale = scale / 5;
this.changeDetectorRef.detectChanges();
}
}
}
async touchEnd(zoomslides: IonSlides, card) {
// Zoom back to normal
const slider = await zoomslides.getSwiper();
const zoom = slider.zoom;
zoom.out();
// Card back to normal
card.el.style['z-index'] = 9;
this.zoomActive = false;
this.changeDetectorRef.detectChanges();
}
touchStart(card) {
// Make card appear above backdrop
card.el.style['z-index'] = 11;
}
downloadFileMsg(msg: MessageService) {
console.log('FILE TYPE', msg.file.type)
this.downloadFile = "";