Files
doneit-web/src/app/shared/popover/messages-options/messages-options.page.ts
T

50 lines
1.2 KiB
TypeScript
Raw Normal View History

2020-12-30 11:13:50 +01:00
import { Component, OnInit } from '@angular/core';
2021-03-18 09:25:59 +01:00
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
2021-01-13 10:02:30 +01:00
import { ChatService } from 'src/app/services/chat.service';
import { ThemeService } from 'src/app/services/theme.service';
2020-12-30 11:13:50 +01:00
@Component({
selector: 'app-messages-options',
templateUrl: './messages-options.page.html',
styleUrls: ['./messages-options.page.scss'],
})
export class MessagesOptionsPage implements OnInit {
2021-01-13 10:02:30 +01:00
roomId:string;
2020-12-30 11:13:50 +01:00
constructor(
2021-01-13 10:02:30 +01:00
private popoverController: PopoverController,
2021-03-18 09:25:59 +01:00
private modalController: ModalController,
2021-01-13 10:02:30 +01:00
private chatService: ChatService,
private navParams: NavParams,
public ThemeService: ThemeService,
2021-08-20 14:45:44 +01:00
)
{
2021-01-13 10:02:30 +01:00
this.roomId = this.navParams.get('roomId');
}
2020-12-30 11:13:50 +01:00
ngOnInit() {
2022-10-11 13:56:56 +01:00
// this.chatService.refreshtoken();
2020-12-30 11:13:50 +01:00
}
close(){
2021-08-20 14:45:44 +01:00
if( window.innerWidth <= 701){
this.modalController.dismiss();
2021-03-18 09:25:59 +01:00
this.popoverController.dismiss();
}
else{
this.modalController.dismiss();
2021-08-20 14:45:44 +01:00
this.popoverController.dismiss();
2021-03-18 09:25:59 +01:00
}
2020-12-30 11:13:50 +01:00
}
2021-01-13 10:02:30 +01:00
closeChatRoom(){
let body = { "roomId": this.roomId }
this.chatService.removeChatRoom(body).subscribe(res=>{
2022-04-28 09:32:27 +01:00
2021-01-13 10:02:30 +01:00
});
this.close();
}
2020-12-30 11:13:50 +01:00
}