From e5a33523d9d2f6fd82f2f4f414f689fe94c96465 Mon Sep 17 00:00:00 2001 From: binwiederhier Date: Sat, 11 Feb 2023 14:32:50 -0500 Subject: [PATCH] Why is this so hard --- web/src/components/SubscribeDialog.js | 2 +- web/src/components/SubscriptionPopup.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/components/SubscribeDialog.js b/web/src/components/SubscribeDialog.js index a8627621..365078c1 100644 --- a/web/src/components/SubscribeDialog.js +++ b/web/src/components/SubscribeDialog.js @@ -74,7 +74,7 @@ const SubscribePage = (props) => { const existingBaseUrls = Array .from(new Set([publicBaseUrl, ...props.subscriptions.map(s => s.baseUrl)])) .filter(s => s !== config.base_url); - const showReserveTopicCheckbox = config.enable_reservations && session.exists() && !anotherServerVisible; + 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 handleSubscribe = async () => { diff --git a/web/src/components/SubscriptionPopup.js b/web/src/components/SubscriptionPopup.js index d3a7b613..e0f3cd52 100644 --- a/web/src/components/SubscriptionPopup.js +++ b/web/src/components/SubscriptionPopup.js @@ -39,7 +39,7 @@ export const SubscriptionPopup = (props) => { const reservations = account?.reservations || []; const showReservationAdd = config.enable_reservations && !subscription?.reservation && account?.stats.reservations_remaining > 0; - const showReservationAddDisabled = config.enable_reservations && !subscription?.reservation && (config.enable_payments || account?.stats.reservations_remaining === 0); + const showReservationAddDisabled = !showReservationAdd && config.enable_reservations && !subscription?.reservation && (config.enable_payments || account?.stats.reservations_remaining === 0); const showReservationEdit = config.enable_reservations && !!subscription?.reservation; const showReservationDelete = config.enable_reservations && !!subscription?.reservation; @@ -258,7 +258,7 @@ export const ReserveLimitChip = () => { if (account?.stats.reservations_remaining > 0) { return <>; } else if (config.enable_payments) { - return ; + return (account?.limits.reservations > 0) ? : ; } else if (account) { return ; }