Skip to content

Commit 7bcd956

Browse files
feat: exclude optional dep when managing if checkoptionaldep == false
close #24
1 parent 87a5024 commit 7bcd956

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

resources/dist.rc

-3 Bytes
Binary file not shown.

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,8 @@ export const Manage = () => {
769769

770770
if (recursive) {
771771
if (enabled) {
772-
const deps = mod?.dependencies;
772+
const deps = mod?.dependencies
773+
.filter((v) => checkOptionalDep || !v.optional)
773774

774775
for (const dep of deps ?? []) {
775776
if (!('_missing' in dep)) {
@@ -782,7 +783,9 @@ export const Manage = () => {
782783
(v) =>
783784
!('_missing' in v) &&
784785
!v.dependedBy.some((v) => v.enabled && v.name !== name)
785-
);
786+
).filter((v) =>
787+
checkOptionalDep || !v.optional
788+
)
786789

787790
for (const dep of orphanDeps ?? []) {
788791
addToSwitchList(dep.name);
@@ -842,7 +845,8 @@ export const Manage = () => {
842845
fullTree,
843846
showUpdate,
844847
alwaysOnMods,
845-
modComments
848+
modComments,
849+
checkOptionalDep
846850
]
847851
);
848852

0 commit comments

Comments
 (0)