diff --git a/packages/shared/src/components/cards/ad/common/getAdFaviconImageLink.ts b/packages/shared/src/components/cards/ad/common/getAdFaviconImageLink.ts index 2fb770433e6..59558885a2a 100644 --- a/packages/shared/src/components/cards/ad/common/getAdFaviconImageLink.ts +++ b/packages/shared/src/components/cards/ad/common/getAdFaviconImageLink.ts @@ -4,7 +4,7 @@ import { adFaviconPlaceholder } from '../../../../lib/image'; interface GetAdFaviconImageLinkParams { ad: Ad; - adImprovementsV3: boolean; + adImprovementsV3?: boolean; size?: number; } diff --git a/packages/shared/src/components/feeds/useFeedContentPreferenceMutationSubscription.ts b/packages/shared/src/components/feeds/useFeedContentPreferenceMutationSubscription.ts index fafc13577ca..9b90095712f 100644 --- a/packages/shared/src/components/feeds/useFeedContentPreferenceMutationSubscription.ts +++ b/packages/shared/src/components/feeds/useFeedContentPreferenceMutationSubscription.ts @@ -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, @@ -78,6 +78,10 @@ export const useFeedContentPreferenceMutationSubscription = ({ }; } + if (isFeedApiHighlightItem(edge.node)) { + return edge; + } + const newPostData = updatePostContentPreference({ data: edge.node, status: nextStatus, diff --git a/packages/shared/src/components/integrations/UserSourceIntegrationList.tsx b/packages/shared/src/components/integrations/UserSourceIntegrationList.tsx index 3d685c96452..1e1ce88fd06 100644 --- a/packages/shared/src/components/integrations/UserSourceIntegrationList.tsx +++ b/packages/shared/src/components/integrations/UserSourceIntegrationList.tsx @@ -43,7 +43,7 @@ export const UserSourceIntegrationList = ({ event.stopPropagation(); await removeSourceIntegration({ - sourceId: sourceIntegration.source.id, + sourceId: sourceIntegration.source.id!, integrationId, integrationType: sourceIntegration.userIntegration.type, }); diff --git a/packages/shared/src/components/utilities/DateFormat.spec.tsx b/packages/shared/src/components/utilities/DateFormat.spec.tsx index 8589248e750..40b64e10b67 100644 --- a/packages/shared/src/components/utilities/DateFormat.spec.tsx +++ b/packages/shared/src/components/utilities/DateFormat.spec.tsx @@ -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(() => { diff --git a/packages/shared/src/features/briefing/components/BriefPayForGenerateCard.tsx b/packages/shared/src/features/briefing/components/BriefPayForGenerateCard.tsx index 93ecc49beeb..7e77595d94d 100644 --- a/packages/shared/src/features/briefing/components/BriefPayForGenerateCard.tsx +++ b/packages/shared/src/features/briefing/components/BriefPayForGenerateCard.tsx @@ -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 = diff --git a/packages/shared/src/features/opportunity/hooks/useOpportunities.ts b/packages/shared/src/features/opportunity/hooks/useOpportunities.ts index 905d9c6459b..5aa61866b2a 100644 --- a/packages/shared/src/features/opportunity/hooks/useOpportunities.ts +++ b/packages/shared/src/features/opportunity/hooks/useOpportunities.ts @@ -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, }), diff --git a/packages/shared/src/features/opportunity/hooks/useOpportunityMatches.ts b/packages/shared/src/features/opportunity/hooks/useOpportunityMatches.ts index 79da6754f4b..054d6183083 100644 --- a/packages/shared/src/features/opportunity/hooks/useOpportunityMatches.ts +++ b/packages/shared/src/features/opportunity/hooks/useOpportunityMatches.ts @@ -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, }), diff --git a/packages/shared/src/hooks/comments/useDeleteComment.ts b/packages/shared/src/hooks/comments/useDeleteComment.ts index 82d47e6ee03..3411427d782 100644 --- a/packages/shared/src/hooks/comments/useDeleteComment.ts +++ b/packages/shared/src/hooks/comments/useDeleteComment.ts @@ -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], ), diff --git a/packages/shared/src/hooks/useCheckLocation.ts b/packages/shared/src/hooks/useCheckLocation.ts index a51183ba659..c7688afe4d4 100644 --- a/packages/shared/src/hooks/useCheckLocation.ts +++ b/packages/shared/src/hooks/useCheckLocation.ts @@ -16,7 +16,7 @@ export const useCheckLocation = (): void => { location: Pick; }>(CHECK_LOCATION_QUERY); await updateUser({ - ...user, + ...user!, hasLocationSet: !!result, }); },