Skip to content

Commit

Permalink
fix: levels
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 15, 2024
1 parent d24a014 commit 7d40573
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/renderer/src/lib/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import * as semver from "semver"
import { getStorageNS } from "./ns"

export const levels = {
view: "view",
folder: "folder",
feed: "feed",
entry: "entry",
}

export const views = [
Expand Down Expand Up @@ -86,4 +84,6 @@ export const ROUTE_FEED_PENDING = "all"
export const ROUTE_ENTRY_PENDING = "pending"
export const ROUTE_FEED_IN_FOLDER = "folder-"

export const channel = import.meta.env.DEV ? "development" : ((semver.prerelease(APP_VERSION)?.[0] as string) || "stable")
export const channel = import.meta.env.DEV ?
"development" :
(semver.prerelease(APP_VERSION)?.[0] as string) || "stable"
1 change: 1 addition & 0 deletions src/renderer/src/modules/entry-column/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const useEntriesByView = () => {
view,
...(unreadOnly === true && { read: false }),
})

const entries = useEntryIdsByFeedIdOrView(isAllFeeds ? view : feedId!, {
unread: unreadOnly,
view,
Expand Down
3 changes: 1 addition & 2 deletions src/renderer/src/modules/feed-column/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ProfileButton } from "@renderer/components/user-button"
import { useNavigateEntry } from "@renderer/hooks/biz/useNavigateEntry"
import { useReduceMotion } from "@renderer/hooks/biz/useReduceMotion"
import { getRouteParams } from "@renderer/hooks/biz/useRouteParams"
import { levels, views } from "@renderer/lib/constants"
import { views } from "@renderer/lib/constants"
import { stopPropagation } from "@renderer/lib/dom"
import { Routes } from "@renderer/lib/enum"
import { shortcuts } from "@renderer/lib/shortcuts"
Expand Down Expand Up @@ -36,7 +36,6 @@ const useBackHome = (active: number) => {
feedId: null,
entryId: null,
view: overvideActive ?? active,
level: levels.view,
})
},
[active, navigate],
Expand Down
1 change: 0 additions & 1 deletion src/renderer/src/modules/feed-column/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ export function FeedList({
navigate({
entryId: null,
feedId: null,
level: levels.view,
view,
})
}
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/src/modules/search/cmdk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
TooltipTrigger,
} from "@renderer/components/ui/tooltip"
import { useNavigateEntry } from "@renderer/hooks/biz/useNavigateEntry"
import { ROUTE_ENTRY_PENDING } from "@renderer/lib/constants"
import { levels, ROUTE_ENTRY_PENDING } from "@renderer/lib/constants"
import { cn, pluralize } from "@renderer/lib/utils"
import { getFeedById } from "@renderer/store/feed"
import { searchActions, useSearchStore } from "@renderer/store/search"
Expand Down Expand Up @@ -252,6 +252,8 @@ const SearchItem = memo(function Item({
navigateEntry({
feedId: item.feedId!,
entryId: item.entryId,

level: levels.feed,
})
}}
>
Expand Down Expand Up @@ -295,7 +297,6 @@ const SearchResultCount: FC<{
{pluralize("result", count)}
{" "}
(Local mode)

<i className="i-mingcute-question-line" />
</small>
</TooltipTrigger>
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/pages/(main)/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { levels, ROUTE_ENTRY_PENDING, ROUTE_FEED_PENDING } from "@renderer/lib/constants"
import { ROUTE_ENTRY_PENDING, ROUTE_FEED_PENDING } from "@renderer/lib/constants"
import { FeedViewType } from "@renderer/lib/enum"
import { redirect } from "react-router-dom"

Expand All @@ -8,4 +8,4 @@ export function Component() {

export const loader = () =>
// navigate to the first feed
redirect(`/feeds/${ROUTE_FEED_PENDING}/${ROUTE_ENTRY_PENDING}?view=${FeedViewType.Articles}&level=${levels.view}`)
redirect(`/feeds/${ROUTE_FEED_PENDING}/${ROUTE_ENTRY_PENDING}?view=${FeedViewType.Articles}`)

0 comments on commit 7d40573

Please sign in to comment.