Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for beta-only modules and settings #1047

Merged
merged 3 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion extension/data/modules/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const self = new Module({
id: 'openContextInPopup',
type: 'boolean',
default: true,
beta: false,
description: 'Add a link to comments where appropiate to open the context in a popup on page.',
},
{
Expand Down
2 changes: 0 additions & 2 deletions extension/data/modules/modbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,6 @@ export default new Module({
$(`
<button
id="tb-prerelease-link"
href="${TBCore.link('/r/tb_beta')}"
target="_blank"
title="this is a ${TBCore.buildType} build of toolbox. click to copy version information"
/>
<i class="tb-icons">${icons.prerelease}</i>
Expand Down
2 changes: 0 additions & 2 deletions extension/data/modules/queuetools.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ const self = new Module({
id: 'showReportReasons',
type: 'boolean',
default: false,
beta: false,
description: 'Add button to show reports on posts with ignored reports.',
},
//
Expand Down Expand Up @@ -144,7 +143,6 @@ const self = new Module({
id: 'highlightAutomodMatches',
type: 'boolean',
default: true,
beta: false,
description:
'Highlight words in Automoderator report and action reasons which are enclosed in []. Can be used to highlight automod regex matches.',
oldReddit: true,
Expand Down
28 changes: 0 additions & 28 deletions extension/data/tbmodule.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,6 @@ const TBModule = {
return;
}

// Don't do anything with beta modules unless this is a beta build
if (module.beta && !['beta', 'dev'].includes(TBCore.buildType)) {
// skip this module entirely
log.debug(`Beta mode not enabled. Skipping ${module.name} module`);
return;
}

// Don't do anything with dev modules unless debug mode is enabled
if (!await getSettingAsync('Utils', 'debugMode', false) && module.debugMode) {
// skip this module entirely
Expand Down Expand Up @@ -684,11 +677,6 @@ const TBModule = {
// Sort the module list alphabetically
const sortedModules = TBModule.modules.sort((a, b) => a.name.localeCompare(b.name));
for (const module of sortedModules) {
// Don't do anything with beta modules unless this is a beta build
if (!['beta', 'dev'].includes(TBCore.buildType) && module.beta) {
continue;
}

// Don't do anything with dev modules unless debug mode is enabled
if (!debugMode && module.debugMode) {
continue;
Expand Down Expand Up @@ -765,11 +753,6 @@ const TBModule = {
// continue;
// }

// hide beta stuff unless this is a beta build
if (options.beta && !['beta', 'dev'].includes(TBCore.buildType)) {
continue;
}

// hide debug stuff unless debug mode enabled
if (options.debug && !debugMode) {
continue;
Expand Down Expand Up @@ -1204,8 +1187,6 @@ export default TBModule;
* @prop {any} default The default value of the setting, or a function (possibly
* async) that returns a default value
* @prop {string} [storageKey] The storage key associated with the setting
* @prop {boolean} [beta=false] If true, the setting will only show up when beta
* mode is enabled
* @prop {boolean} [debug=false] If true, the setting will only show up when
* debug mode is enabled
* @prop {boolean} [advanced=false] If true, the setting will only show up when
Expand All @@ -1225,8 +1206,6 @@ export class Module {
* will be enabled on fresh installs
* @param {boolean} [options.alwaysEnabled=false] If true, the module cannot
* be disabled
* @param {boolean} [options.beta=false] If true, the module will only show
* up in beta builds
* @param {boolean} [options.debug=false] If true, the module will only show
* up when debug mode is enabled
* @param {boolean} [options.oldReddit=false] If true, the module will be
Expand All @@ -1241,7 +1220,6 @@ export class Module {
id = name.replace(/\s/g, ''),
enabledByDefault = false,
alwaysEnabled = false,
beta = false,
debug = false,
oldReddit = false,
settings = [],
Expand All @@ -1259,11 +1237,6 @@ export class Module {
* @prop {boolean} alwaysEnabled If true, the module cannot be disabled
*/
this.alwaysEnabled = alwaysEnabled;
/**
* @prop {boolean} beta If true, the module will only show up when beta
* mode is enabled
*/
this.beta = beta;
/**
* @prop {boolean} debugMode If true, the module will only show up when
* debug mode is enabled
Expand All @@ -1289,7 +1262,6 @@ export class Module {
this.settings.set(setting.id, {
description: `(${setting.id})`,
storageKey: `${id}.${setting.id}`,
beta: false,
debug: false,
advanced: false,
hidden: false,
Expand Down