fix(context-menu): ensure submenu is only transformed if it has items
- Updated the submenu transformation logic to check for item length before processing, preventing unnecessary transformations. - Adjusted the EntryTitle component's hover effect class for improved scaling behavior. Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
parent
b3a2fdb1fb
commit
b6eb586121
|
|
@ -103,9 +103,10 @@ function transformMenuItemsForNative(nextItems: FollowMenuItem[]): ElectronMenuI
|
|||
(!item.disabled && item.click !== undefined) || (!!item.submenu && item.submenu.length > 0),
|
||||
accelerator: item.shortcut?.replace("Meta", "CmdOrCtrl"),
|
||||
checked: typeof item.checked === "boolean" ? item.checked : undefined,
|
||||
submenu: item.submenu
|
||||
? transformMenuItemsForNative(filterNullableMenuItems(item.submenu))
|
||||
: undefined,
|
||||
submenu:
|
||||
item.submenu.length > 0
|
||||
? transformMenuItemsForNative(filterNullableMenuItems(item.submenu))
|
||||
: undefined,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ export const EntryTitle = ({ entryId, compact }: EntryLinkProps) => {
|
|||
href={populatedFullHref ?? "#"}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="cursor-link hover:multi-[scale-105;opacity-95] inline-block select-text break-words text-[1.7rem] font-bold leading-normal duration-200"
|
||||
className="cursor-link hover:multi-[scale-[1.01];opacity-95] inline-block select-text break-words text-[1.7rem] font-bold leading-normal duration-200"
|
||||
>
|
||||
<EntryTranslation
|
||||
source={entry.entries.title}
|
||||
|
|
|
|||
Loading…
Reference in New Issue