mirror of
https://github.com/binwiederhier/ntfy.git
synced 2024-11-22 19:33:27 +01:00
Derp
This commit is contained in:
parent
e5a33523d9
commit
4cbf1f5371
3 changed files with 7 additions and 11 deletions
|
@ -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"]
|
||||
};
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -33,13 +33,10 @@ const UpgradeDialog = (props) => {
|
|||
const fullScreen = useMediaQuery(theme.breakpoints.down('sm'));
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
try {
|
||||
setTiers(await accountApi.billingTiers());
|
||||
} catch (e) {
|
||||
setError(e.message);
|
||||
}
|
||||
})();
|
||||
const fetchTiers = async () => {
|
||||
setTiers(await accountApi.billingTiers());
|
||||
}
|
||||
fetchTiers(); // Dangle
|
||||
}, []);
|
||||
|
||||
if (!tiers) {
|
||||
|
|
Loading…
Reference in a new issue