pull/526/head
binwiederhier 2023-02-11 20:38:13 -05:00
parent e5a33523d9
commit 4cbf1f5371
3 changed files with 7 additions and 11 deletions

View File

@ -12,5 +12,5 @@ var config = {
enable_signup: true, enable_signup: true,
enable_payments: true, enable_payments: true,
enable_reservations: true, enable_reservations: true,
disallowed_topics: ["docs", "static", "file", "app", "account", "settings", "pricing", "signup", "login", "reset-password"] disallowed_topics: ["docs", "static", "file", "app", "account", "settings", "signup", "login"]
}; };

View File

@ -17,7 +17,7 @@ import DialogFooter from "./DialogFooter";
import {useTranslation} from "react-i18next"; import {useTranslation} from "react-i18next";
import session from "../app/Session"; import session from "../app/Session";
import routes from "./routes"; import routes from "./routes";
import accountApi, {Role} from "../app/AccountApi"; import accountApi, {Permission, Role} from "../app/AccountApi";
import ReserveTopicSelect from "./ReserveTopicSelect"; import ReserveTopicSelect from "./ReserveTopicSelect";
import {AccountContext} from "./App"; import {AccountContext} from "./App";
import {TopicReservedError, UnauthorizedError} from "../app/errors"; import {TopicReservedError, UnauthorizedError} from "../app/errors";
@ -67,7 +67,7 @@ const SubscribePage = (props) => {
const [error, setError] = useState(""); const [error, setError] = useState("");
const [reserveTopicVisible, setReserveTopicVisible] = useState(false); const [reserveTopicVisible, setReserveTopicVisible] = useState(false);
const [anotherServerVisible, setAnotherServerVisible] = useState(false); const [anotherServerVisible, setAnotherServerVisible] = useState(false);
const [everyone, setEveryone] = useState("deny-all"); const [everyone, setEveryone] = useState(Permission.DENY_ALL);
const baseUrl = (anotherServerVisible) ? props.baseUrl : config.base_url; const baseUrl = (anotherServerVisible) ? props.baseUrl : config.base_url;
const topic = props.topic; const topic = props.topic;
const existingTopicUrls = props.subscriptions.map(s => topicUrl(s.baseUrl, s.topic)); const existingTopicUrls = props.subscriptions.map(s => topicUrl(s.baseUrl, s.topic));
@ -99,7 +99,6 @@ const SubscribePage = (props) => {
console.log(`[SubscribeDialog] Reserving topic ${topic} with everyone access ${everyone}`); console.log(`[SubscribeDialog] Reserving topic ${topic} with everyone access ${everyone}`);
try { try {
await accountApi.upsertReservation(topic, everyone); await accountApi.upsertReservation(topic, everyone);
// Account sync later after it was added
} catch (e) { } catch (e) {
console.log(`[SubscribeDialog] Error reserving topic`, e); console.log(`[SubscribeDialog] Error reserving topic`, e);
if (e instanceof UnauthorizedError) { if (e instanceof UnauthorizedError) {

View File

@ -33,13 +33,10 @@ const UpgradeDialog = (props) => {
const fullScreen = useMediaQuery(theme.breakpoints.down('sm')); const fullScreen = useMediaQuery(theme.breakpoints.down('sm'));
useEffect(() => { useEffect(() => {
(async () => { const fetchTiers = async () => {
try {
setTiers(await accountApi.billingTiers()); setTiers(await accountApi.billingTiers());
} catch (e) {
setError(e.message);
} }
})(); fetchTiers(); // Dangle
}, []); }, []);
if (!tiers) { if (!tiers) {