New fullscreen chat WIP:
* Fullscreen chat: now uses a custom page (in other words: when opening the chat in a new tab, you will have the Peertube menu). WIP * some code refactoring (getBaseRoute moved to util/uri, ...)
This commit is contained in:
18
client/utils/uri.ts
Normal file
18
client/utils/uri.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import type { RegisterClientOptions } from '@peertube/peertube-types/client'
|
||||
|
||||
function getBaseRoute ({ peertubeHelpers }: RegisterClientOptions, permanent: boolean = false): string {
|
||||
if (permanent) {
|
||||
return '/plugins/livechat/router'
|
||||
}
|
||||
// NB: this will come with Peertube > 3.2.1 (3.3.0?)
|
||||
if (peertubeHelpers.getBaseRouterRoute) {
|
||||
return peertubeHelpers.getBaseRouterRoute()
|
||||
}
|
||||
// We are guessing the route with the correct plugin version with this trick:
|
||||
const staticBase = peertubeHelpers.getBaseStaticRoute()
|
||||
return staticBase.replace(/\/static.*$/, '/router')
|
||||
}
|
||||
|
||||
export {
|
||||
getBaseRoute
|
||||
}
|
Reference in New Issue
Block a user