fix: navigate to current view by search

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei 2024-07-16 00:38:38 +08:00
parent 4b4c935cbc
commit 6b39a4bc20
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
1 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import { getReadonlyRoute, getStableRouterNavigate } from "@renderer/atoms/route"
import { setSidebarActiveView } from "@renderer/atoms/sidebar"
import { ROUTE_ENTRY_PENDING, ROUTE_FEED_PENDING } from "@renderer/lib/constants"
import type { FeedViewType } from "@renderer/lib/enum"
import { isUndefined } from "lodash-es"
@ -27,7 +28,10 @@ export const navigateEntry = (options: NavigateEntryOptions) => {
const nextSearchParams = new URLSearchParams(searchParams)
!isUndefined(view) && nextSearchParams.set("view", view.toString())
if (!isUndefined(view)) {
nextSearchParams.set("view", view.toString())
setSidebarActiveView(view)
}
level && nextSearchParams.set("level", level.toString())
return getStableRouterNavigate()?.(