[mirotalksfu] - add confirmation before delete poll

هذا الالتزام موجود في:
Miroslav Pejic
2024-11-16 19:43:24 +01:00
الأصل 2f7e632656
التزام ca653afcb1
2 ملفات معدلة مع 24 إضافات و4 حذوفات

عرض الملف

@@ -1315,6 +1315,7 @@ function joinRoom(peer_name, room_id) {
if (rc && rc.isConnected()) {
console.log('Already connected to a room');
} else {
const isDesktopDevice = !DetectRTC.isMobileDevice && !isTabletDevice && !isIPadDevice;
console.log('05 ----> join Room ' + room_id);
roomId.innerText = room_id;
userName.innerText = peer_name;
@@ -1330,6 +1331,7 @@ function joinRoom(peer_name, room_id) {
peer_name,
peer_uuid,
peer_info,
isDesktopDevice,
isAudioAllowed,
isVideoAllowed,
isScreenAllowed,

عرض الملف

@@ -195,6 +195,7 @@ class RoomClient {
peer_name,
peer_uuid,
peer_info,
isDesktopDevice,
isAudioAllowed,
isVideoAllowed,
isScreenAllowed,
@@ -216,6 +217,11 @@ class RoomClient {
this.peer_uuid = peer_uuid;
this.peer_info = peer_info;
// Device type
this.isDesktopDevice = isDesktopDevice;
this.isMobileDevice = DetectRTC.isMobileDevice;
this.isMobileSafari = this.isMobileDevice && DetectRTC.browser.name === 'Safari';
// RTMP selected file name
this.selectedRtmpFilename = '';
@@ -258,9 +264,6 @@ class RoomClient {
this.consumerTransport = null;
this.device = null;
this.isMobileDevice = DetectRTC.isMobileDevice;
this.isMobileSafari = this.isMobileDevice && DetectRTC.browser.name === 'Safari';
this.isScreenShareSupported =
navigator.getDisplayMedia || navigator.mediaDevices.getDisplayMedia ? true : false;
@@ -4792,7 +4795,22 @@ class RoomClient {
deletePollButton.className = 'del-btn';
deletePollButton.insertBefore(deletePollButtonIcon, deletePollButton.firstChild);
deletePollButton.addEventListener('click', () => {
this.socket.emit('deletePoll', { index, peer_name: this.peer_name, peer_uuid: this.peer_uuid });
// confirm before delete poll
Swal.fire({
background: swalBackground,
position: 'top',
title: 'Delete this poll?',
imageUrl: image.delete,
showDenyButton: true,
confirmButtonText: `Yes`,
denyButtonText: `No`,
showClass: { popup: 'animate__animated animate__fadeInDown' },
hideClass: { popup: 'animate__animated animate__fadeOutUp' },
}).then((result) => {
if (result.isConfirmed) {
this.socket.emit('deletePoll', { index, peer_name: this.peer_name, peer_uuid: this.peer_uuid });
}
});
});
pollButtonsDiv.appendChild(deletePollButton);