()
| 155 | } |
| 156 | |
| 157 | async function loadModifiers() { |
| 158 | try { |
| 159 | let res = await fetch("/get/modifiers") |
| 160 | if (res.status === 200) { |
| 161 | res = await res.json() |
| 162 | |
| 163 | modifiers = res // update global variable |
| 164 | |
| 165 | res.reverse() |
| 166 | |
| 167 | res.forEach((modifierGroup, idx) => { |
| 168 | const isInitiallyOpen = false // idx === res.length - 1 |
| 169 | const removeBy = modifierGroup === "Artist" ? true : false // only remove "By " for artists |
| 170 | |
| 171 | createModifierGroup(modifierGroup, isInitiallyOpen, removeBy) |
| 172 | }) |
| 173 | |
| 174 | createCollapsibles(editorModifierEntries) |
| 175 | } |
| 176 | } catch (e) { |
| 177 | console.error("error fetching modifiers", e) |
| 178 | } |
| 179 | |
| 180 | loadCustomModifiers() |
| 181 | resizeModifierCards(modifierCardSizeSlider.value) |
| 182 | document.dispatchEvent(new Event("loadImageModifiers")) |
| 183 | } |
| 184 | |
| 185 | function refreshModifiersState(newTags, inactiveTags) { |
| 186 | // clear existing modifiers |
nothing calls this directly
no test coverage detected