Skip to content

Commit

Permalink
Fix init pattern bug and clean up base code (#48)
Browse files Browse the repository at this point in the history
Some fixes @humitos noted post-review

---------

Co-authored-by: Manuel Kaufmann <humitos@gmail.com>
  • Loading branch information
agjohnson and humitos authored Apr 13, 2023
1 parent 83bb85d commit 9cf1500
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/readthedocs-client.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ export class AnalyticsAddon extends AddonBase {
}

static isEnabled(config) {
return this.config.features && this.config.features.analytics.enabled;
return config.features && config.features.analytics.enabled;
}
}
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function setup() {
];

for (const addon of addons) {
if (addon.isEnabled) {
if (addon.isEnabled(config)) {
promises.push(
new Promise((resolve) => {
resolve(new addon(config));
Expand Down
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const domReady = new Promise((resolve) => {
* and loading.
*/
export class AddonBase {
static isEnabled() {
static isEnabled(config) {
return false;
}
}

0 comments on commit 9cf1500

Please sign in to comment.