stream-chat
Advanced tools
Comparing version 8.28.0 to 8.29.0
{ | ||
"name": "stream-chat", | ||
"version": "8.28.0", | ||
"version": "8.29.0", | ||
"description": "JS SDK for the Stream Chat API", | ||
@@ -5,0 +5,0 @@ "author": "GetStream", |
@@ -11,2 +11,3 @@ import FormData from 'form-data'; | ||
FormatMessageResponse, | ||
ReactionGroupResponse, | ||
} from './types'; | ||
@@ -299,2 +300,7 @@ import { AxiosRequestConfig } from 'axios'; | ||
status: message.status || 'received', | ||
reaction_groups: maybeGetReactionGroupsFallback( | ||
message.reaction_groups, | ||
message.reaction_counts, | ||
message.reaction_scores, | ||
), | ||
}; | ||
@@ -369,1 +375,26 @@ } | ||
} | ||
function maybeGetReactionGroupsFallback( | ||
groups: { [key: string]: ReactionGroupResponse } | null | undefined, | ||
counts: { [key: string]: number } | null | undefined, | ||
scores: { [key: string]: number } | null | undefined, | ||
): { [key: string]: ReactionGroupResponse } | null { | ||
if (groups) { | ||
return groups; | ||
} | ||
if (counts && scores) { | ||
const fallback: { [key: string]: ReactionGroupResponse } = {}; | ||
for (const type of Object.keys(counts)) { | ||
fallback[type] = { | ||
count: counts[type], | ||
sum_scores: scores[type], | ||
}; | ||
} | ||
return fallback; | ||
} | ||
return null; | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5876438
62024