schoolbox web extension :)
0
fork

Configure Feed

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

fix(utils): add `dataAttr` in query selectors

willow 267ce511 066654d5

+7 -8
+7 -8
src/utils/index.ts
··· 130 130 } 131 131 132 132 // check not already injected 133 - const style = document.querySelector(`userSnippet-${id}`); 133 + const style = document.querySelector(dataAttr(`userSnippet-${id}`)); 134 134 if (style) { 135 135 logger.info(`user snippet with id ${id} already injected, aborting`); 136 136 return; ··· 150 150 151 151 export function uninjectUserSnippet(id: string) { 152 152 logger.info(`uninjecting user snippet with id ${id}`); 153 - const style = document.querySelector(`userSnippet-${id}`); 154 - if (style) { 155 - document.head.removeChild(style); 156 - logger.info(`uninjected user snippet with id ${id}`); 157 - } else { 158 - // logger.warn(`user snippet with id ${id} not found, aborting`) 159 - } 153 + 154 + const style = document.querySelector(dataAttr(`userSnippet-${id}`)); 155 + if (!style) return; 156 + 157 + document.head.removeChild(style); 158 + logger.info(`uninjected user snippet with id ${id}`); 160 159 } 161 160 162 161 export function hasChanged<T>(newValue: T, oldValue: T, keys: (keyof T)[]) {