Use location.origin as default base URL
This commit is contained in:
parent
c5ce51f242
commit
420e35c33c
7 changed files with 16 additions and 19 deletions
|
@ -1,5 +0,0 @@
|
|||
//const config = window.config;
|
||||
const config = {
|
||||
defaultBaseUrl: "https://ntfy.sh"
|
||||
};
|
||||
export default config;
|
|
@ -1,5 +1,4 @@
|
|||
import {rawEmojis} from "./emojis";
|
||||
import config from "./config";
|
||||
|
||||
export const topicUrl = (baseUrl, topic) => `${baseUrl}/${topic}`;
|
||||
export const topicUrlWs = (baseUrl, topic) => `${topicUrl(baseUrl, topic)}/ws`
|
||||
|
@ -116,7 +115,7 @@ export const openUrl = (url) => {
|
|||
};
|
||||
|
||||
export const subscriptionRoute = (subscription) => {
|
||||
if (subscription.baseUrl !== config.defaultBaseUrl) {
|
||||
if (subscription.baseUrl !== window.location.origin) {
|
||||
return `/${shortUrl(subscription.baseUrl)}/${subscription.topic}`;
|
||||
}
|
||||
return `/${subscription.topic}`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue