diff --git a/web/src/app/config.js b/web/src/app/config.js
deleted file mode 100644
index 1976d79e..00000000
--- a/web/src/app/config.js
+++ /dev/null
@@ -1,5 +0,0 @@
-//const config = window.config;
-const config = {
- defaultBaseUrl: "https://ntfy.sh"
-};
-export default config;
diff --git a/web/src/app/utils.js b/web/src/app/utils.js
index 10ff28b8..c047ff7e 100644
--- a/web/src/app/utils.js
+++ b/web/src/app/utils.js
@@ -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}`;
diff --git a/web/src/components/App.js b/web/src/components/App.js
index d40da9d3..119deca7 100644
--- a/web/src/components/App.js
+++ b/web/src/components/App.js
@@ -21,8 +21,11 @@ import {BrowserRouter, Route, Routes, useLocation, useNavigate} from "react-rout
import {subscriptionRoute} from "../app/utils";
// TODO support unsubscribed routes
+// TODO add "home" route that is selected when nothing else fits
// TODO new notification indicator
// TODO sound
+// TODO "copy url" toast
+// TODO "copy link url" button
const App = () => {
return (
@@ -87,6 +90,8 @@ const Root = () => {
connectionManager.resetStateListener();
connectionManager.resetNotificationListener();
}
+// This is for the use of 'navigate' // FIXME
+//eslint-disable-next-line
}, [/* initial render */]);
useEffect(() => { connectionManager.refresh(subscriptions, users) }, [subscriptions, users]); // Dangle!
return (
diff --git a/web/src/components/Navigation.js b/web/src/components/Navigation.js
index bc1fa8e1..eb98914d 100644
--- a/web/src/components/Navigation.js
+++ b/web/src/components/Navigation.js
@@ -17,7 +17,6 @@ import Typography from "@mui/material/Typography";
import {subscriptionRoute, topicShortUrl, topicUrl} from "../app/utils";
import {ConnectionState} from "../app/Connection";
import {useLocation, useNavigate} from "react-router-dom";
-import config from "../app/config";
const navWidth = 240;
@@ -125,7 +124,7 @@ const SubscriptionItem = (props) => {
const icon = (subscription.state === ConnectionState.Connecting)
?
: ;
- const label = (subscription.baseUrl === config.defaultBaseUrl)
+ const label = (subscription.baseUrl === window.location.origin)
? subscription.topic
: topicShortUrl(subscription.baseUrl, subscription.topic);
return (
diff --git a/web/src/components/Notifications.js b/web/src/components/Notifications.js
index 38e8c9c4..61ac0694 100644
--- a/web/src/components/Notifications.js
+++ b/web/src/components/Notifications.js
@@ -76,7 +76,7 @@ const NotificationItem = (props) => {
{date}
{[1,2,4,5].includes(notification.priority) &&
}
diff --git a/web/src/components/Preferences.js b/web/src/components/Preferences.js
index 608dc3be..6f5ac0eb 100644
--- a/web/src/components/Preferences.js
+++ b/web/src/components/Preferences.js
@@ -281,7 +281,7 @@ const UserDialog = (props) => {
setUsername(props.user.username);
setPassword(props.user.password);
}
- }, []);
+ }, [editMode, props.user]);
return (