[mirotalk] - fix: cancel pending rAF in showDisconnectBanner to prevent stuck banner on fast reconnect
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
# ====================================================
|
||||
# MiroTalk P2P v.1.8.32 - Environment Configuration
|
||||
# MiroTalk P2P v.1.8.33 - Environment Configuration
|
||||
# ====================================================
|
||||
|
||||
# App environment
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/**
|
||||
* ==============================================
|
||||
* MiroTalk P2P v.1.8.32 - Configuration File
|
||||
* MiroTalk P2P v.1.8.33 - Configuration File
|
||||
* ==============================================
|
||||
*
|
||||
* This file is the central configuration source.
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ dependencies: {
|
||||
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
|
||||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
|
||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||
* @version 1.8.32
|
||||
* @version 1.8.33
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "mirotalk",
|
||||
"version": "1.8.32",
|
||||
"version": "1.8.33",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "mirotalk",
|
||||
"version": "1.8.32",
|
||||
"version": "1.8.33",
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
"@mattermost/client": "11.6.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mirotalk",
|
||||
"version": "1.8.32",
|
||||
"version": "1.8.33",
|
||||
"description": "A free WebRTC browser-based video call",
|
||||
"main": "server.js",
|
||||
"scripts": {
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ let brand = {
|
||||
},
|
||||
about: {
|
||||
imageUrl: '../images/mirotalk-logo.gif',
|
||||
title: 'WebRTC P2P v1.8.32',
|
||||
title: 'WebRTC P2P v1.8.33',
|
||||
html: `
|
||||
<button
|
||||
id="support-button"
|
||||
|
||||
+14
-5
@@ -15,7 +15,7 @@
|
||||
* @license For commercial use or closed source, contact us at license.mirotalk@gmail.com or purchase directly from CodeCanyon
|
||||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-p2p-webrtc-realtime-video-conferences/38376661
|
||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||
* @version 1.8.32
|
||||
* @version 1.8.33
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -517,6 +517,7 @@ const icon = getId('disconnectBannerIcon');
|
||||
const title = getId('disconnectBannerTitle');
|
||||
const msg = getId('disconnectBannerMsg');
|
||||
const spinner = getId('disconnectBannerSpinner');
|
||||
let disconnectBannerRafId = null;
|
||||
|
||||
//....
|
||||
|
||||
@@ -15812,7 +15813,7 @@ function showAbout() {
|
||||
Swal.fire({
|
||||
background: swBg,
|
||||
position: 'center',
|
||||
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.8.32',
|
||||
title: brand.about?.title && brand.about.title.trim() !== '' ? brand.about.title : 'WebRTC P2P v1.8.33',
|
||||
imageUrl: brand.about?.imageUrl && brand.about.imageUrl.trim() !== '' ? brand.about.imageUrl : images.about,
|
||||
customClass: { image: 'img-about' },
|
||||
html: renderRoomTemplate('tpl-about-modal', {
|
||||
@@ -16075,15 +16076,23 @@ function showDisconnectBanner() {
|
||||
title.textContent = 'Connection lost';
|
||||
msg.innerHTML = 'Reconnecting to signaling server\u2026';
|
||||
spinner.style.opacity = '1';
|
||||
// Trigger transition
|
||||
requestAnimationFrame(() => banner.classList.add('visible'));
|
||||
if (disconnectBannerRafId) cancelAnimationFrame(disconnectBannerRafId);
|
||||
disconnectBannerRafId = requestAnimationFrame(() => {
|
||||
disconnectBannerRafId = null;
|
||||
banner.classList.add('visible');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Hide the disconnect banner (or briefly show a reconnected confirmation).
|
||||
*/
|
||||
function hideDisconnectBanner() {
|
||||
if (!banner || !banner.classList.contains('visible')) return;
|
||||
if (!banner) return;
|
||||
if (disconnectBannerRafId) {
|
||||
cancelAnimationFrame(disconnectBannerRafId);
|
||||
disconnectBannerRafId = null;
|
||||
}
|
||||
if (!banner.classList.contains('visible')) return;
|
||||
banner.classList.add('reconnected');
|
||||
icon.className = 'fa-solid fa-circle-check';
|
||||
title.textContent = 'Back online';
|
||||
|
||||
Reference in New Issue
Block a user