This commit is contained in:
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_payments: 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 session from "../app/Session";
import routes from "./routes";
import accountApi, {Role} from "../app/AccountApi";
import accountApi, {Permission, Role} from "../app/AccountApi";
import ReserveTopicSelect from "./ReserveTopicSelect";
import {AccountContext} from "./App";
import {TopicReservedError, UnauthorizedError} from "../app/errors";
@ -67,7 +67,7 @@ const SubscribePage = (props) => {
const [error, setError] = useState("");
const [reserveTopicVisible, setReserveTopicVisible] = 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 topic = props.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}`);
try {
await accountApi.upsertReservation(topic, everyone);
// Account sync later after it was added
} catch (e) {
console.log(`[SubscribeDialog] Error reserving topic`, e);
if (e instanceof UnauthorizedError) {

View file

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