diff --git a/docs/releases.md b/docs/releases.md index 192c0900..a2cd1d05 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -9,6 +9,10 @@ and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/release * Support for publishing to protected topics via email with access tokens ([#612](https://github.com/binwiederhier/ntfy/pull/621), thanks to [@tamcore](https://github.com/tamcore)) * Support for base64-encoded and nested multipart emails ([#610](https://github.com/binwiederhier/ntfy/issues/610), thanks to [@Robert-litts](https://github.com/Robert-litts)) +**Bug fixes + maintenance:** + +* Web: Do not disable "Reserve topic" checkbox for admins (no ticket, thanks to @xenrox for reporting) + **Additional languages:** * Arabic (thanks to [@ButterflyOfFire](https://hosted.weblate.org/user/ButterflyOfFire/)) diff --git a/web/src/components/SubscribeDialog.js b/web/src/components/SubscribeDialog.js index 7ea00520..4fd4f8c4 100644 --- a/web/src/components/SubscribeDialog.js +++ b/web/src/components/SubscribeDialog.js @@ -75,7 +75,7 @@ const SubscribePage = (props) => { .from(new Set([publicBaseUrl, ...props.subscriptions.map(s => s.baseUrl)])) .filter(s => s !== config.base_url); const showReserveTopicCheckbox = config.enable_reservations && !anotherServerVisible && (config.enable_payments || account); - const reserveTopicEnabled = session.exists() && account?.role === Role.USER && (account?.stats.reservations_remaining || 0) > 0; + const reserveTopicEnabled = session.exists() && (account?.role === Role.ADMIN || (account?.role === Role.USER && (account?.stats.reservations_remaining || 0) > 0)); const handleSubscribe = async () => { const user = await userManager.get(baseUrl); // May be undefined diff --git a/web/src/components/SubscriptionPopup.js b/web/src/components/SubscriptionPopup.js index b33313c9..7655605d 100644 --- a/web/src/components/SubscriptionPopup.js +++ b/web/src/components/SubscriptionPopup.js @@ -11,7 +11,7 @@ import theme from "./theme"; import subscriptionManager from "../app/SubscriptionManager"; import DialogFooter from "./DialogFooter"; import {useTranslation} from "react-i18next"; -import accountApi from "../app/AccountApi"; +import accountApi, {Role} from "../app/AccountApi"; import session from "../app/Session"; import routes from "./routes"; import MenuItem from "@mui/material/MenuItem"; @@ -255,7 +255,7 @@ const DisplayNameDialog = (props) => { export const ReserveLimitChip = () => { const { account } = useContext(AccountContext); - if (account?.stats.reservations_remaining > 0) { + if (account?.role === Role.ADMIN || account?.stats.reservations_remaining > 0) { return <>; } else if (config.enable_payments) { return (account?.limits.reservations > 0) ? : ;