schoolbox web extension :)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(plugins): only inject if elements present

willow 765c4dcb 8ba21a13

+6 -5
+6 -5
src/utils/plugin.ts
··· 87 87 } 88 88 } 89 89 90 - async reload() { 91 - if (this.injected) this.uninject(); 92 - if (await this.isEnabled()) this.inject(); 93 - } 94 - 95 90 private inject() { 96 91 if (this.injected) return; 92 + if (!this.allElementsPresent()) return; 97 93 logger.info(`injecting plugin: ${this.meta.name}`); 98 94 this.injectCallback(this.settings); 99 95 this.injected = true; ··· 104 100 logger.info(`uninjecting plugin: ${this.meta.name}`); 105 101 this.uninjectCallback(this.settings); 106 102 this.injected = false; 103 + } 104 + 105 + private async reload() { 106 + if (this.injected) this.uninject(); 107 + if (await this.isEnabled()) this.inject(); 107 108 } 108 109 109 110 private async isEnabled(): Promise<boolean> {