[mirotalk] - fix: cancel pending rAF in showDisconnectBanner to prevent stuck banner on fast reconnect

This commit is contained in:
Miroslav Pejic
2026-05-06 23:14:04 +02:00
parent d88015de7b
commit 345ecef173
7 changed files with 21 additions and 12 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
# ====================================================
# MiroTalk P2P v.1.8.32 - Environment Configuration
# MiroTalk P2P v.1.8.33 - Environment Configuration
# ====================================================
# App environment
+1 -1
View File
@@ -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
View File
@@ -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
*
*/
+2 -2
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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';