feat: add notification for timeline switch (#4176)

This commit is contained in:
Konv Suu 2025-07-16 18:24:07 +08:00 committed by GitHub
parent e119ab640d
commit 1fdf482f35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import { nextFrame } from "@follow/utils/dom"
import { EventBus } from "@follow/utils/event-bus"
import type { FC } from "react"
import { memo, useEffect } from "react"
import { toast } from "sonner"
import { FocusablePresets } from "~/components/common/Focusable"
import { useNavigateEntry } from "~/hooks/biz/useNavigateEntry"
@ -63,6 +64,11 @@ export const EntryColumnShortcutHandler: FC<{
const nextIndex = Math.min(currentActiveEntryIndex + 1, data.length - 1)
if (currentActiveEntryIndex === nextIndex) {
toast.info("You are already at the last entry")
return
}
handleScrollTo(nextIndex)
const nextId = data![nextIndex]
@ -80,6 +86,11 @@ export const EntryColumnShortcutHandler: FC<{
const nextIndex =
currentActiveEntryIndex === -1 ? data.length - 1 : Math.max(0, currentActiveEntryIndex - 1)
if (currentActiveEntryIndex === nextIndex) {
toast.info("You are already at the first entry")
return
}
handleScrollTo(nextIndex)
const nextId = data![nextIndex]