Handle permission userinfo using new logic

This commit is contained in:
Ajay
2022-08-14 00:14:59 -04:00
parent fdbcf47149
commit 99c5375c6a
3 changed files with 12 additions and 5 deletions

View File

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