Skip to content
This repository was archived by the owner on May 19, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function CreateApiKeyModal() {
let expiresAt: string | undefined;

if (values.expiration === "custom" && values.customDate) {
expiresAt = values.customDate.toISOString();
expiresAt = new Date(values.customDate).toISOString();
} else if (values.expiration !== "never") {
const days = parseInt(values.expiration, 10);
expiresAt = new Date(Date.now() + days * 24 * 60 * 60 * 1000).toISOString();
Expand Down Expand Up @@ -106,7 +106,7 @@ export default function CreateApiKeyModal() {
<DateInput
label={t("Custom expiration date")}
placeholder={t("Select expiration date")}
minDate={new Date()}
minDate={new Date(Date.now() + 24 * 60 * 60 * 1000)}
required
{...form.getInputProps("customDate")}
/>
Expand Down
23 changes: 14 additions & 9 deletions apps/client/src/features/comment/queries/comment-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,20 @@ export function useCreateCommentMutation() {
) as InfiniteData<IPagination<IComment>> | undefined;

if (cache && cache.pages.length > 0) {
const lastIdx = cache.pages.length - 1;
queryClient.setQueryData(RQ_KEY(newComment.pageId), {
...cache,
pages: cache.pages.map((page, i) =>
i === lastIdx
? { ...page, items: [...page.items, newComment] }
: page,
),
});
const alreadyExists = cache.pages.some((page) =>
page.items.some((c) => c.id === newComment.id),
);
if (!alreadyExists) {
const lastIdx = cache.pages.length - 1;
queryClient.setQueryData(RQ_KEY(newComment.pageId), {
...cache,
pages: cache.pages.map((page, i) =>
i === lastIdx
? { ...page, items: [...page.items, newComment] }
: page,
),
});
}
}

notifications.show({ message: t("Comment created successfully") });
Expand Down
Loading