From 1fdf482f3557767d844705dc8ee1a67bf5a2cc39 Mon Sep 17 00:00:00 2001 From: Konv Suu <2583695112@qq.com> Date: Wed, 16 Jul 2025 18:24:07 +0800 Subject: [PATCH] feat: add notification for timeline switch (#4176) --- .../entry-column/EntryColumnShortcutHandler.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/desktop/layer/renderer/src/modules/entry-column/EntryColumnShortcutHandler.tsx b/apps/desktop/layer/renderer/src/modules/entry-column/EntryColumnShortcutHandler.tsx index 1efdb3204..fe4eaa10f 100644 --- a/apps/desktop/layer/renderer/src/modules/entry-column/EntryColumnShortcutHandler.tsx +++ b/apps/desktop/layer/renderer/src/modules/entry-column/EntryColumnShortcutHandler.tsx @@ -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]