diff --git a/apps/client/src/widgets/launch_bar/GenericButtons.tsx b/apps/client/src/widgets/launch_bar/GenericButtons.tsx index 9af775760..69982040f 100644 --- a/apps/client/src/widgets/launch_bar/GenericButtons.tsx +++ b/apps/client/src/widgets/launch_bar/GenericButtons.tsx @@ -1,8 +1,9 @@ import { useCallback } from "preact/hooks"; + import appContext from "../../components/app_context"; import FNote from "../../entities/fnote"; import link_context_menu from "../../menus/link_context_menu"; -import { escapeHtml, isCtrlKey } from "../../services/utils"; +import { isCtrlKey } from "../../services/utils"; import { useGlobalShortcut, useNoteLabel } from "../react/hooks"; import { LaunchBarActionButton, useLauncherIconAndTitle } from "./launch_bar_widgets"; @@ -26,7 +27,7 @@ export function CustomNoteLauncher({ launcherNote, getTargetNoteId, getHoistedNo const ctrlKey = isCtrlKey(evt); if ((evt.which === 1 && ctrlKey) || evt.which === 2) { - const activate = evt.shiftKey ? true : false; + const activate = !!evt.shiftKey; await appContext.tabManager.openInNewTab(targetNoteId, hoistedNoteIdWithDefault, activate); } else { await appContext.tabManager.openInSameTab(targetNoteId); @@ -40,7 +41,7 @@ export function CustomNoteLauncher({ launcherNote, getTargetNoteId, getHoistedNo return ( { @@ -51,5 +52,5 @@ export function CustomNoteLauncher({ launcherNote, getTargetNoteId, getHoistedNo } }} /> - ) + ); } diff --git a/apps/client/src/widgets/launch_bar/launch_bar_widgets.tsx b/apps/client/src/widgets/launch_bar/launch_bar_widgets.tsx index e3f219c93..0cb7c9906 100644 --- a/apps/client/src/widgets/launch_bar/launch_bar_widgets.tsx +++ b/apps/client/src/widgets/launch_bar/launch_bar_widgets.tsx @@ -1,17 +1,17 @@ import { createContext } from "preact"; +import { useContext } from "preact/hooks"; + import FNote from "../../entities/fnote"; -import { escapeHtml } from "../../services/utils"; import ActionButton, { ActionButtonProps } from "../react/ActionButton"; import Dropdown, { DropdownProps } from "../react/Dropdown"; import { useNoteLabel, useNoteProperty } from "../react/hooks"; import Icon from "../react/Icon"; -import { useContext } from "preact/hooks"; export const LaunchBarContext = createContext<{ isHorizontalLayout: boolean; }>({ isHorizontalLayout: false -}) +}); export interface LauncherNoteProps { /** The corresponding {@link FNote} of type {@code launcher} in the hidden subtree of this launcher. Generally this launcher note holds information about the launcher via labels and relations, but also the title and the icon of the launcher. Not to be confused with the target note, which is specific to some launchers. */ @@ -28,7 +28,7 @@ export function LaunchBarActionButton(props: Omit - ) + ); } export function LaunchBarDropdownButton({ children, icon, dropdownOptions, ...props }: Pick & { icon: string }) { @@ -50,7 +50,7 @@ export function LaunchBarDropdownButton({ children, icon, dropdownOptions, ...pr }} {...props} >{children} - ) + ); } export function useLauncherIconAndTitle(note: FNote) { @@ -62,6 +62,6 @@ export function useLauncherIconAndTitle(note: FNote) { return { icon: note.getIcon(), - title: escapeHtml(title ?? "") + title: title ?? "" }; }