From 6631dfdea3584229bba8297632078c6031096bb1 Mon Sep 17 00:00:00 2001 From: Ajay Date: Thu, 1 Sep 2022 16:44:02 -0400 Subject: [PATCH] Also check license status for submitting chapter --- src/components/SponsorTimeEditComponent.tsx | 3 ++- src/utils/licenseKey.ts | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx index 1515644a..90c600af 100644 --- a/src/components/SponsorTimeEditComponent.tsx +++ b/src/components/SponsorTimeEditComponent.tsx @@ -7,6 +7,7 @@ import SubmissionNoticeComponent from "./SubmissionNoticeComponent"; import { RectangleTooltip } from "../render/RectangleTooltip"; import SelectorComponent, { SelectorOption } from "./SelectorComponent"; import { GenericUtils } from "../utils/genericUtils"; +import { noRefreshFetchingChaptersAllowed } from "../utils/licenseKey"; const utils = new Utils(); @@ -402,7 +403,7 @@ class SponsorTimeEditComponent extends React.Component { return false } +/** + * The other one also tried refreshing, so returns a promise + */ +export function noRefreshFetchingChaptersAllowed(): boolean { + return Config.config.payments.chaptersAllowed || CompileConfig["freeChapterAccess"]; +} + export async function fetchingChaptersAllowed(): Promise { if (Config.config.payments.freeAccess || CompileConfig["freeChapterAccess"]) { return true;