Skip to content

Commit

Permalink
fix: preserve deps of always on mods when switch off all
Browse files Browse the repository at this point in the history
close #22
  • Loading branch information
std-microblock committed Aug 23, 2024
1 parent 7bcd956 commit da685aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Binary file modified resources/dist.rc
Binary file not shown.
11 changes: 9 additions & 2 deletions src/celemod-ui/src/routes/Manage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,8 @@ export const Manage = () => {
const deps = mod?.dependencies
.filter((v) => checkOptionalDep || !v.optional)

// console.log('also enable', deps?.map(v => v.name).join(','), 'for', name);

for (const dep of deps ?? []) {
if (!('_missing' in dep)) {
if (excludeFromAutoEnableList.includes(dep.name)) continue;
Expand Down Expand Up @@ -882,10 +884,15 @@ export const Manage = () => {
onClick={() => {
manageCtx.switchMod(
[...installedModsTree.values()]
.map((v) => v.name)
.filter((v) => !alwaysOnMods.includes(v)),
.filter((v) => {
return ('_missing' in v) || v.enabled;
})
.map((v) => v.name),
false
);
manageCtx.switchMod(
alwaysOnMods, true, true
)
}}
>
{_i18n.t('禁用全部')}
Expand Down

0 comments on commit da685aa

Please sign in to comment.