Files
doneit-web/src/app/shared/popover/messages-options/messages-options.page.ts
T
2022-10-12 17:01:09 +01:00

50 lines
1.2 KiB
TypeScript

import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { ChatService } from 'src/app/services/chat.service';
import { ThemeService } from 'src/app/services/theme.service';
@Component({
selector: 'app-messages-options',
templateUrl: './messages-options.page.html',
styleUrls: ['./messages-options.page.scss'],
})
export class MessagesOptionsPage implements OnInit {
roomId:string;
constructor(
private popoverController: PopoverController,
private modalController: ModalController,
private chatService: ChatService,
private navParams: NavParams,
public ThemeService: ThemeService,
)
{
this.roomId = this.navParams.get('roomId');
}
ngOnInit() {
// this.chatService.refreshtoken();
}
close(){
if( window.innerWidth <= 701){
this.modalController.dismiss();
this.popoverController.dismiss();
}
else{
this.modalController.dismiss();
this.popoverController.dismiss();
}
}
closeChatRoom(){
let body = { "roomId": this.roomId }
this.chatService.removeChatRoom(body).subscribe(res=>{
});
this.close();
}
}