Skip to content

Commit da685aa

Browse files
fix: preserve deps of always on mods when switch off all
close #22
1 parent 7bcd956 commit da685aa

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

resources/dist.rc

86 Bytes
Binary file not shown.

src/celemod-ui/src/routes/Manage.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,8 @@ export const Manage = () => {
772772
const deps = mod?.dependencies
773773
.filter((v) => checkOptionalDep || !v.optional)
774774

775+
// console.log('also enable', deps?.map(v => v.name).join(','), 'for', name);
776+
775777
for (const dep of deps ?? []) {
776778
if (!('_missing' in dep)) {
777779
if (excludeFromAutoEnableList.includes(dep.name)) continue;
@@ -882,10 +884,15 @@ export const Manage = () => {
882884
onClick={() => {
883885
manageCtx.switchMod(
884886
[...installedModsTree.values()]
885-
.map((v) => v.name)
886-
.filter((v) => !alwaysOnMods.includes(v)),
887+
.filter((v) => {
888+
return ('_missing' in v) || v.enabled;
889+
})
890+
.map((v) => v.name),
887891
false
888892
);
893+
manageCtx.switchMod(
894+
alwaysOnMods, true, true
895+
)
889896
}}
890897
>
891898
{_i18n.t('禁用全部')}

0 commit comments

Comments
 (0)