Skip to content
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 @@ -4,7 +4,7 @@ import { adFaviconPlaceholder } from '../../../../lib/image';

interface GetAdFaviconImageLinkParams {
ad: Ad;
adImprovementsV3: boolean;
adImprovementsV3?: boolean;
size?: number;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { InfiniteData, QueryKey } from '@tanstack/react-query';
import type { FeedData } from '../../graphql/posts';
import type { FeedItemData } from '../../graphql/feed';
import { isFeedApiPostItem } from '../../graphql/feed';
import { isFeedApiHighlightItem, isFeedApiPostItem } from '../../graphql/feed';
import type { ContentPreferenceMutation } from '../../hooks/contentPreference/types';
import {
contentPreferenceMutationMatcher,
Expand Down Expand Up @@ -78,6 +78,10 @@ export const useFeedContentPreferenceMutationSubscription = ({
};
}

if (isFeedApiHighlightItem(edge.node)) {
return edge;
}

const newPostData = updatePostContentPreference({
data: edge.node,
status: nextStatus,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const UserSourceIntegrationList = ({
event.stopPropagation();

await removeSourceIntegration({
sourceId: sourceIntegration.source.id,
sourceId: sourceIntegration.source.id!,
integrationId,
integrationType: sourceIntegration.userIntegration.type,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const renderComponent = ({
const date = new Date(2024, 6, 6, 12, 30, 30);

beforeEach(() => {
jest.useFakeTimers('modern').setSystemTime(date);
jest.useFakeTimers().setSystemTime(date);
});

afterEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ export const BriefPayForGenerateCard = withBriefContext(() => {
);
const [isBuyOpen, setBuyOpen] = useToggle(false);

const prices = useFeature(briefGeneratePricing);
const prices =
useFeature(briefGeneratePricing) ?? briefGeneratePricing.defaultValue;
const price = prices[briefingType];

const isFirstBrief =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const useOpportunities = ({
const { requestMethod } = useRequestProtocol();

const query = useInfiniteQuery({
queryKey: generateQueryKey(RequestKey.Opportunities, null, {
queryKey: generateQueryKey(RequestKey.Opportunities, undefined, {
state,
first,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const useOpportunityMatches = ({
const { requestMethod } = useRequestProtocol();

const query = useInfiniteQuery({
queryKey: generateQueryKey(RequestKey.OpportunityMatches, null, {
queryKey: generateQueryKey(RequestKey.OpportunityMatches, undefined, {
opportunityId,
status,
}),
Expand Down
5 changes: 4 additions & 1 deletion packages/shared/src/hooks/comments/useDeleteComment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ export function useDeleteComment(): UseDeleteCommentRet {
logEvent(postLogEvent(LogEvent.DeleteComment, post));
await deleteComment(commentId, requestMethod);
displayToast('The comment has been deleted');
removePostComments(client, post, commentId, parentId);
// Callers pass `null` for root comments; `removePostComments` treats
// `parentId === commentId` as the root case, matching the convention
// used in MainComment (`parentId={comment.id}`).
removePostComments(client, post, commentId, parentId ?? commentId);
},
[client, showPrompt, logEvent, displayToast, requestMethod],
),
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/hooks/useCheckLocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const useCheckLocation = (): void => {
location: Pick<LoggedUser, 'hasLocationSet'>;
}>(CHECK_LOCATION_QUERY);
await updateUser({
...user,
...user!,
hasLocationSet: !!result,
});
},
Expand Down
Loading