Skip to content

Commit

Permalink
Fix issue with created Time
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Jul 15, 2024
1 parent 81d5ae5 commit 17040ef
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/extensions/common/CommonChatItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default function CommonChatItem({

const displayedTime = showApproveButton
? createdAtTime
: approvedInRootPostAtTime
: approvedInRootPostAtTime || createdAtTime
const otherMessageCheckMarkElement = (className?: string) => (
<ChatRelativeTime
isUpdated={isUpdated}
Expand Down
2 changes: 2 additions & 0 deletions src/services/datahub/generated-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2906,6 +2906,7 @@ export type SubscribePostSubscription = {
optimisticId?: string | null
dataType: DataType
approvedInRootPost: boolean
approvedInRootPostAtTime?: any | null
createdAtTime?: any | null
rootPost?: { __typename?: 'Post'; persistentId?: string | null } | null
}
Expand Down Expand Up @@ -3695,6 +3696,7 @@ export const SubscribePost = gql`
optimisticId
dataType
approvedInRootPost
approvedInRootPostAtTime
createdAtTime
rootPost {
persistentId
Expand Down
3 changes: 3 additions & 0 deletions src/services/datahub/posts/subscription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const SUBSCRIBE_POST = gql`
optimisticId
dataType
approvedInRootPost
approvedInRootPostAtTime
createdAtTime
rootPost {
persistentId
Expand Down Expand Up @@ -156,6 +157,7 @@ async function processMessage(
...dataFromEntityId,
struct: {
...dataFromEntityId.struct,
approvedInRootPostAtTime: eventData.entity.approvedInRootPostAtTime,
dataType: eventData.entity.dataType,
},
})
Expand All @@ -169,6 +171,7 @@ async function processMessage(
struct: {
...oldData.struct,
approvedInRootPost: eventData.entity.approvedInRootPost,
approvedInRootPostAtTime: eventData.entity.approvedInRootPostAtTime,
},
}
})
Expand Down

0 comments on commit 17040ef

Please sign in to comment.