File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
apps/frontend/src/pages/hosting/manage/[id]/content Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 127127 width: '100%',
128128 }"
129129 >
130- <template v-for =" mod in visibleItems .items " :key =" mod . filename " >
130+ <template v-for =" mod in visibleItems .items " :key =" getStableModKey ( mod ) " >
131131 <div
132132 class =" relative mb-2 flex w-full items-center justify-between rounded-xl bg-bg-raised"
133133 :class =" mod.disabled ? 'bg-table-alternateRow text-secondary' : ''"
245245 </div >
246246
247247 <input
248- :id =" `toggle-${mod.filename }`"
248+ :id =" `toggle-${getStableModKey( mod) }`"
249249 :checked =" !mod.disabled"
250250 :disabled =" mod.changing"
251251 class =" switch stylized-toggle"
@@ -595,6 +595,16 @@ function friendlyModName(mod: ContentItem) {
595595 return cleanName
596596}
597597
598+ function getStableModKey(mod : ContentItem ): string {
599+ if (mod .project_id ) {
600+ return ` project-${mod .project_id } `
601+ }
602+
603+ // external file
604+ const baseFilename = mod .filename .endsWith (' .disabled' ) ? mod .filename .slice (0 , - 9 ) : mod .filename
605+ return ` file-${baseFilename } `
606+ }
607+
598608async function toggleMod(mod : ContentItem ) {
599609 mod .changing = true
600610
You can’t perform that action at this time.
0 commit comments