Redirect participants to meeting ended screen instead of 404.
Deploy Ladill Meet / deploy (push) Successful in 49s
Deploy Ladill Meet / deploy (push) Successful in 49s
Poll and waiting-room clients follow the same redirect when the host ends the call; chat and participants use mobile bottom sheets. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -24,6 +24,11 @@ Alpine.data('waitingRoom', () => ({
|
||||
const res = await fetch(url, { headers: { Accept: 'application/json' } });
|
||||
const data = await res.json();
|
||||
|
||||
if (data.ended && data.redirect) {
|
||||
window.location.href = data.redirect;
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.redirect) {
|
||||
window.location.href = data.redirect;
|
||||
return;
|
||||
|
||||
@@ -73,6 +73,7 @@ function meetRoom() {
|
||||
url: el.dataset.url,
|
||||
configured: el.dataset.configured === '1',
|
||||
pollUrl: el.dataset.pollUrl,
|
||||
endedUrl: el.dataset.endedUrl,
|
||||
chatUrl: el.dataset.chatUrl,
|
||||
reactionUrl: el.dataset.reactionUrl,
|
||||
raiseHandUrl: el.dataset.raiseHandUrl,
|
||||
@@ -1044,7 +1045,18 @@ function meetRoom() {
|
||||
async poll() {
|
||||
try {
|
||||
const res = await fetch(this.config.pollUrl, { headers: { Accept: 'application/json' } });
|
||||
if (!res.ok) {
|
||||
if (res.status === 404 && this.config.endedUrl) {
|
||||
this.redirectToMeetingEnded(this.config.endedUrl);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const data = await res.json();
|
||||
if (data.ended && data.redirect) {
|
||||
this.redirectToMeetingEnded(data.redirect);
|
||||
return;
|
||||
}
|
||||
if (data.participants) {
|
||||
this.sessionParticipants = data.participants;
|
||||
this.pruneTilesFromSession();
|
||||
@@ -1067,6 +1079,19 @@ function meetRoom() {
|
||||
}
|
||||
},
|
||||
|
||||
redirectToMeetingEnded(url) {
|
||||
if (this.pollTimer) {
|
||||
clearInterval(this.pollTimer);
|
||||
this.pollTimer = null;
|
||||
}
|
||||
|
||||
if (room) {
|
||||
room.disconnect().catch(() => {});
|
||||
}
|
||||
|
||||
window.location.href = url;
|
||||
},
|
||||
|
||||
updateChatFromPoll(messages) {
|
||||
const container = document.getElementById('chat-messages');
|
||||
if (!container) return;
|
||||
|
||||
Reference in New Issue
Block a user