Skip to content

Commit

Permalink
feat: Update code
Browse files Browse the repository at this point in the history
nuintun committed Sep 24, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 7e64522 commit e8009ce
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/js/utils/menus.ts
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ export function parse<M = unknown>(
return guard;
};

const isPreserveSelf = (key: string): boolean => {
const shouldRemoveSelf = (key: string): boolean => {
return guards.get(key) !== Filter.PRESERVE_SELF;
};

@@ -88,14 +88,12 @@ export function parse<M = unknown>(
} else {
delete menu.children;

if (isPreserveSelf(key)) {
if (shouldRemoveSelf(key)) {
removeable.add(key);
}
}

menu.children = subset;
} else if (!isAvailable) {
if (isPreserveSelf(key)) {
if (shouldRemoveSelf(key)) {
removeable.add(key);
}
}

0 comments on commit e8009ce

Please sign in to comment.