Skip to content

Commit 663adc6

Browse files
authored
refactor: zod runtime type checks (#2055)
1 parent 7b27bd2 commit 663adc6

File tree

6 files changed

+21
-27
lines changed

6 files changed

+21
-27
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"rehype-remark": "^10.0.1",
116116
"remark-parse": "^11.0.0",
117117
"remark-stringify": "^11.0.0",
118-
"threadiverse": "^0.2.5",
118+
"threadiverse": "^0.3.3",
119119
"ua-parser-js": "^2.0.3",
120120
"unified": "^11.0.5",
121121
"unist-util-visit": "^5.0.0",

pnpm-lock.yaml

Lines changed: 11 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/routes/pages/inbox/InboxPage.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,11 @@ export default function InboxPage({ showRead }: InboxPageProps) {
3131
const fetchFn: FetchFn<InboxItemView> = async (pageData, ...rest) => {
3232
if (!myUserId) throw new Error("Logged out");
3333

34-
const params = {
35-
limit: 50,
36-
...pageData,
37-
unread_only: !showRead,
38-
};
39-
4034
const notifications = await client.getNotifications(
4135
{
42-
...params,
43-
sort: "New",
36+
limit: 50,
37+
...pageData,
38+
unread_only: !showRead,
4439
},
4540
...rest,
4641
);

src/routes/pages/inbox/MentionsPage.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export default function MentionsPage() {
2222
{
2323
...pageData,
2424
limit: LIMIT,
25-
sort: "New",
2625
unread_only: false,
2726
},
2827
...rest,

src/routes/pages/inbox/RepliesPage.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export default function RepliesPage({ type }: RepliesPageProps) {
2727
{
2828
...pageData,
2929
limit: 50,
30-
sort: "New",
3130
unread_only: false,
3231
},
3332
...rest,

src/routes/pages/profile/ProfileFeedSavedPage.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,25 @@ import { useParams } from "react-router-dom";
22

33
import { FetchFn } from "#/features/feed/Feed";
44
import { PostCommentItem } from "#/features/feed/PostCommentFeed";
5+
import { getUserIfNeeded } from "#/features/user/userSlice";
56
import useClient from "#/helpers/useClient";
67
import { LIMIT } from "#/services/lemmy";
8+
import { useAppDispatch } from "#/store";
79

810
import BaseProfileFeedItemsPage from "./BaseProfileFeedItemsPage";
911

1012
export default function ProfileFeedSavedPage() {
1113
const { handle } = useParams<{ handle: string }>();
1214
const client = useClient();
15+
const dispatch = useAppDispatch();
1316

1417
const fetchFn: FetchFn<PostCommentItem> = async (pageData, ...rest) => {
18+
const person = await dispatch(getUserIfNeeded(handle));
19+
1520
const { content } = await client.listPersonSaved(
1621
{
1722
...pageData,
18-
username: handle,
23+
person_id: person.id,
1924
limit: LIMIT,
2025
},
2126
...rest,

0 commit comments

Comments
 (0)