schoolbox web extension :)
0
fork

Configure Feed

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

fix: allElementsPresent fn call and watchers

willow dcef77c7 a068d122

+5 -3
+3 -2
src/utils/plugin.ts
··· 28 28 29 29 const inject = async () => { 30 30 if (injected) return; 31 - if (!allElementsPresent) return; 31 + if (!allElementsPresent()) return; 32 32 logger.info(`injecting plugin: ${plugins[pluginId].name}`); 33 33 injectCallback(await getSettingsValues(plugins[pluginId]?.settings)); 34 34 injected = true; ··· 43 43 44 44 const initWatchers = () => { 45 45 // add watchers for injecting plugin 46 - globalSettings.watch((newValue, oldValue) => { 46 + globalSettings.watch(async (newValue, oldValue) => { 47 47 if (hasChanged(newValue, oldValue, ["global", "plugins"])) { 48 + const plugin = await plugins[pluginId].toggle.get(); 48 49 if (newValue.global && newValue.plugins && plugin.toggle) { 49 50 inject(); 50 51 } else {
+2 -1
src/utils/snippet.ts
··· 27 27 } 28 28 29 29 // settings watcher for uninjection/injection 30 - globalSettings.watch((newValue, oldValue) => { 30 + globalSettings.watch(async (newValue, oldValue) => { 31 31 if (hasChanged(newValue, oldValue, ["global", "snippets"])) { 32 + const snippet = await snippets[snippetId].toggle.get(); 32 33 if (newValue.global && newValue.snippets && snippet.toggle) { 33 34 inject(); 34 35 } else {