Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mobile): update types and star entry with view #2728

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions apps/mobile/src/modules/context-menu/entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ import { collectionSyncService } from "@/src/store/collection/store"
import { useEntry } from "@/src/store/entry/hooks"
import { unreadSyncService } from "@/src/store/unread/store"

import { useSelectedView } from "../feed-drawer/atoms"

export const EntryItemContextMenu = ({ id, children }: PropsWithChildren<{ id: string }>) => {
const entry = useEntry(id)
const view = useSelectedView()
const isEntryStarred = useIsEntryStarred(id)

const handlePressPreview = useCallback(() => {
Expand Down Expand Up @@ -66,11 +69,14 @@ export const EntryItemContextMenu = ({ id, children }: PropsWithChildren<{ id: s
toast.error("Feed not found")
return
}
if (!view) {
toast.error("View not found")
return
}
collectionSyncService.starEntry({
feedId: entry.feedId,
entryId: id,
// TODO update view
view: 0,
view,
})
toast.info("Starred")
}
Expand Down
Loading