|
15 | 15 | * @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon |
16 | 16 | * @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661 |
17 | 17 | * @author Miroslav Pejic - miroslav.pejic.85@gmail.com |
18 | | - * @version 1.8.32 |
| 18 | + * @version 1.8.33 |
19 | 19 | * |
20 | 20 | */ |
21 | 21 |
|
@@ -517,6 +517,7 @@ const icon = getId('disconnectBannerIcon'); |
517 | 517 | const title = getId('disconnectBannerTitle'); |
518 | 518 | const msg = getId('disconnectBannerMsg'); |
519 | 519 | const spinner = getId('disconnectBannerSpinner'); |
| 520 | +let disconnectBannerRafId = null; |
520 | 521 |
|
521 | 522 | //.... |
522 | 523 |
|
@@ -15812,7 +15813,7 @@ function showAbout() { |
15812 | 15813 | Swal.fire({ |
15813 | 15814 | background: swBg, |
15814 | 15815 | position: 'center', |
15815 | | - title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.8.32', |
| 15816 | + title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.8.33', |
15816 | 15817 | imageUrl: brand.about?.imageUrl && brand.about.imageUrl.trim() !== '' ? brand.about.imageUrl : images.about, |
15817 | 15818 | customClass: { image: 'img-about' }, |
15818 | 15819 | html: renderRoomTemplate('tpl-about-modal', { |
@@ -16075,15 +16076,23 @@ function showDisconnectBanner() { |
16075 | 16076 | title.textContent = 'Connection lost'; |
16076 | 16077 | msg.innerHTML = 'Reconnecting to signaling server\u2026'; |
16077 | 16078 | spinner.style.opacity = '1'; |
16078 | | - // Trigger transition |
16079 | | - requestAnimationFrame(() => banner.classList.add('visible')); |
| 16079 | + if (disconnectBannerRafId) cancelAnimationFrame(disconnectBannerRafId); |
| 16080 | + disconnectBannerRafId = requestAnimationFrame(() => { |
| 16081 | + disconnectBannerRafId = null; |
| 16082 | + banner.classList.add('visible'); |
| 16083 | + }); |
16080 | 16084 | } |
16081 | 16085 |
|
16082 | 16086 | /** |
16083 | 16087 | * Hide the disconnect banner (or briefly show a reconnected confirmation). |
16084 | 16088 | */ |
16085 | 16089 | function hideDisconnectBanner() { |
16086 | | - if (!banner || !banner.classList.contains('visible')) return; |
| 16090 | + if (!banner) return; |
| 16091 | + if (disconnectBannerRafId) { |
| 16092 | + cancelAnimationFrame(disconnectBannerRafId); |
| 16093 | + disconnectBannerRafId = null; |
| 16094 | + } |
| 16095 | + if (!banner.classList.contains('visible')) return; |
16087 | 16096 | banner.classList.add('reconnected'); |
16088 | 16097 | icon.className = 'fa-solid fa-circle-check'; |
16089 | 16098 | title.textContent = 'Back online'; |
|
0 commit comments