Skip to content

Commit

Permalink
Merge pull request #38554 from situchan/fix-38516
Browse files Browse the repository at this point in the history
[CP Staging] fix concierge avatar not showing in preview
  • Loading branch information
Hayata Suenaga authored Mar 19, 2024
2 parents 9cb79b8 + 2563af3 commit 0d700c3
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/components/Image/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,19 @@ function Image({source: propsSource, isAuthTokenRequired = false, session, ...fo
* to the source.
*/
const source = useMemo(() => {
const authToken = session?.encryptedAuthToken ?? null;
if (isAuthTokenRequired && typeof propsSource === 'object' && 'uri' in propsSource && authToken) {
return {
...propsSource,
headers: {
[CONST.CHAT_ATTACHMENT_TOKEN_KEY]: authToken,
},
};
if (typeof propsSource === 'object' && 'uri' in propsSource) {
if (typeof propsSource.uri === 'number') {
return propsSource.uri;
}
const authToken = session?.encryptedAuthToken ?? null;
if (isAuthTokenRequired && authToken) {
return {
...propsSource,
headers: {
[CONST.CHAT_ATTACHMENT_TOKEN_KEY]: authToken,
},
};
}
}
return propsSource;
// The session prop is not required, as it causes the image to reload whenever the session changes. For more information, please refer to issue #26034.
Expand Down

0 comments on commit 0d700c3

Please sign in to comment.