Add option to show categories you don't have permission to submit

This commit is contained in:
Ajay
2022-09-16 22:41:39 -04:00
parent 47f685bcdd
commit 4804c7f439
4 changed files with 26 additions and 2 deletions

View File

@@ -404,8 +404,10 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
for (const category of (this.props.categoryList ?? CompileConfig.categoryList)) {
// If permission not loaded, treat it like we have permission except chapter
const defaultBlockCategories = ["chapter"];
const permission = Config.config.permissions[category as Category] && (category !== "chapter" || noRefreshFetchingChaptersAllowed());
if ((defaultBlockCategories.includes(category) || permission !== undefined) && !permission) continue;
const permission = (Config.config.showCategoryWithoutPermission
|| Config.config.permissions[category as Category]) && (category !== "chapter" || noRefreshFetchingChaptersAllowed());
if ((defaultBlockCategories.includes(category)
|| (permission !== undefined && !Config.config.showCategoryWithoutPermission)) && !permission) continue;
elements.push(
<option value={category}