Merge branch 'main' into develop

This commit is contained in:
John Livingston
2021-12-08 19:41:43 +01:00
5 changed files with 18 additions and 2 deletions

View File

@ -5,6 +5,15 @@ async function register ({ peertubeHelpers, registerHook, registerVideoField }:
handler: () => {
const container = document.querySelector('#peertube-plugin-livechat-container')
if (container) {
const url = container.getAttribute('peertube-plugin-livechat-current-url')
if (url && url === window.location.href) {
console.warn(
'[peertube-plugin-livechat navigation-end] ' +
'It seems that action:router.navigation-end was called after action:video-watch.video.loaded. ' +
'No removing the chat from the DOM.'
)
return
}
container.remove()
}
}

View File

@ -289,6 +289,7 @@ function register ({ registerHook, peertubeHelpers }: RegisterOptions): void {
container = document.createElement('div')
container.setAttribute('id', 'peertube-plugin-livechat-container')
container.setAttribute('peertube-plugin-livechat-state', 'initializing')
container.setAttribute('peertube-plugin-livechat-current-url', window.location.href)
placeholder.append(container)
peertubeHelpers.getSettings().then((s: any) => {