File tree Expand file tree Collapse file tree
apps/desktop/layer/renderer/src/modules/entry-column Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { nextFrame } from "@follow/utils/dom"
88import { EventBus } from "@follow/utils/event-bus"
99import type { FC } from "react"
1010import { memo , useEffect } from "react"
11+ import { toast } from "sonner"
1112
1213import { FocusablePresets } from "~/components/common/Focusable"
1314import { useNavigateEntry } from "~/hooks/biz/useNavigateEntry"
@@ -63,6 +64,11 @@ export const EntryColumnShortcutHandler: FC<{
6364
6465 const nextIndex = Math . min ( currentActiveEntryIndex + 1 , data . length - 1 )
6566
67+ if ( currentActiveEntryIndex === nextIndex ) {
68+ toast . info ( "You are already at the last entry" )
69+ return
70+ }
71+
6672 handleScrollTo ( nextIndex )
6773 const nextId = data ! [ nextIndex ]
6874
@@ -80,6 +86,11 @@ export const EntryColumnShortcutHandler: FC<{
8086 const nextIndex =
8187 currentActiveEntryIndex === - 1 ? data . length - 1 : Math . max ( 0 , currentActiveEntryIndex - 1 )
8288
89+ if ( currentActiveEntryIndex === nextIndex ) {
90+ toast . info ( "You are already at the first entry" )
91+ return
92+ }
93+
8394 handleScrollTo ( nextIndex )
8495 const nextId = data ! [ nextIndex ]
8596
You can’t perform that action at this time.
0 commit comments