New chat integration:
* refactoring * cleaning * using peertubeHelpers to get authent info when available
This commit is contained in:
@ -46,7 +46,9 @@ async function registerConfiguration (clientOptions: RegisterClientOptions): Pro
|
||||
converseRoot.classList.add('theme-peertube')
|
||||
container.append(converseRoot)
|
||||
|
||||
window.initConverse(converseJSParams, 'embedded')
|
||||
const authHeader = peertubeHelpers.getAuthHeader()
|
||||
|
||||
window.initConverse(converseJSParams, 'peertube-fullpage', authHeader ?? null)
|
||||
} catch (err) {
|
||||
console.error('[peertube-plugin-livechat] ' + (err as string))
|
||||
rootEl.innerText = await peertubeHelpers.translate(LOC_NOT_FOUND)
|
||||
|
@ -1,6 +1,7 @@
|
||||
import type { InitConverseJSParams } from 'shared/lib/types'
|
||||
import { computeAutoColors } from './colors'
|
||||
|
||||
// FIXME
|
||||
// declare global {
|
||||
// interface Window {
|
||||
// converse?: {
|
||||
@ -12,6 +13,7 @@ import { computeAutoColors } from './colors'
|
||||
// }
|
||||
// }
|
||||
|
||||
// FIXME: better declaration
|
||||
declare global {
|
||||
interface Window {
|
||||
converse?: any
|
||||
|
Reference in New Issue
Block a user