Skip to content

Commit

Permalink
fix: remove duplicated shortcuts
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 31, 2024
1 parent 3843905 commit bc3ecde
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
1 change: 1 addition & 0 deletions src/renderer/src/modules/entry-column/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ function EntryItemImpl({
useCallback(
(e) => {
e.preventDefault()

showNativeMenu(
[
...items
Expand Down
19 changes: 0 additions & 19 deletions src/renderer/src/modules/entry-content/header.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { ActionButton } from "@renderer/components/ui/button"
import { shortcuts } from "@renderer/constants/shortcuts"
import { useEntryActions } from "@renderer/hooks/biz/useEntryActions"
import { cn } from "@renderer/lib/utils"
import { useEntry } from "@renderer/store/entry/hooks"
import { AnimatePresence, m } from "framer-motion"
import { useHotkeys } from "react-hotkeys-hook"

import { useEntryContentScrollToTop, useEntryTitleMeta } from "./atoms"
import { EntryReadHistory } from "./read-history"
Expand All @@ -25,23 +23,6 @@ export function EntryHeader({
entry,
})

useHotkeys(
shortcuts.entry.toggleStarred.key,
() => {
const key = entry?.collections ? "unstar" : "star"
items.find((item) => item.key === key)?.onClick()
},
{ scopes: ["home"] },
)

useHotkeys(
shortcuts.entry.openInBrowser.key,
() => {
items.find((item) => item.key === "openInBrowser")?.onClick()
},
{ scopes: ["home"] },
)

const entryTitleMeta = useEntryTitleMeta()
const isAtTop = useEntryContentScrollToTop()
const shouldShowMeta = !isAtTop && entryTitleMeta
Expand Down

0 comments on commit bc3ecde

Please sign in to comment.