mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2026-03-29 00:58:50 +03:00
Add option to show categories you don't have permission to submit
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -65,6 +65,7 @@ interface SBConfig {
|
||||
darkMode: boolean,
|
||||
showCategoryGuidelines: boolean,
|
||||
chaptersAvailable: boolean,
|
||||
showCategoryWithoutPermission: boolean,
|
||||
|
||||
// Used to cache calculated text color info
|
||||
categoryPillColors: {
|
||||
@@ -195,6 +196,7 @@ const Config: SBObject = {
|
||||
darkMode: true,
|
||||
showCategoryGuidelines: true,
|
||||
chaptersAvailable: true,
|
||||
showCategoryWithoutPermission: false,
|
||||
|
||||
categoryPillColors: {},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user