Support external routes
This commit is contained in:
parent
b5670d9a71
commit
52a55f71e6
10 changed files with 52 additions and 52 deletions
2
web/src/app/config.js
Normal file
2
web/src/app/config.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
const config = window.config;
|
||||
export default config;
|
|
@ -1,4 +1,5 @@
|
|||
import {rawEmojis} from "./emojis";
|
||||
import config from "./config";
|
||||
|
||||
export const topicUrl = (baseUrl, topic) => `${baseUrl}/${topic}`;
|
||||
export const topicUrlWs = (baseUrl, topic) => `${topicUrl(baseUrl, topic)}/ws`
|
||||
|
@ -115,6 +116,9 @@ export const openUrl = (url) => {
|
|||
};
|
||||
|
||||
export const subscriptionRoute = (subscription) => {
|
||||
if (subscription.baseUrl !== config.defaultBaseUrl) {
|
||||
return `/${shortUrl(subscription.baseUrl)}/${subscription.topic}`;
|
||||
}
|
||||
return `/${subscription.topic}`;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue