Fix #48: Proper 404 and 403 pages when trying to open non-existant chatroom (WIP).

This commit is contained in:
John Livingston
2024-04-04 10:58:16 +02:00
parent 972306aa3e
commit 0719d25f35
12 changed files with 198 additions and 104 deletions

View File

@ -26,8 +26,12 @@ async function registerRoom (clientOptions: RegisterClientOptions): Promise<void
await displayConverseJS(clientOptions, container, roomKey, 'peertube-fullpage', forceType)
} catch (err) {
console.error('[peertube-plugin-livechat] ' + (err as string))
// FIXME: do a better error page.
rootEl.innerText = await peertubeHelpers.translate(LOC_NOT_FOUND)
// Displaying an error page.
rootEl.innerHTML = ''
const message = document.createElement('div')
message.classList.add('peertube-plugin-livechat-error-message')
message.innerText = await peertubeHelpers.translate(LOC_CHATROOM_NOT_ACCESSIBLE)
rootEl.append(message)
}
}
})