Skip to content

Commit

Permalink
fix: pinned menu returns a blank screen for certain rooms. (#5934)
Browse files Browse the repository at this point in the history
  • Loading branch information
OtavioStasiak authored Oct 30, 2024
1 parent c34a110 commit 14e0857
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/containers/message/Urls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,14 @@ type TImageLoadedState = 'loading' | 'done' | 'error';
const Url = ({ url }: { url: IUrl }) => {
const { colors, theme } = useTheme();
const { baseUrl, user } = useContext(MessageContext);
let image = url.image || url.url;
image = image.includes('http') ? image : `${baseUrl}/${image}?rc_uid=${user.id}&rc_token=${user.token}`;
const getImageUrl = () => {
const imageUrl = url.image || url.url;

if (!imageUrl) return null;
if (imageUrl.includes('http')) return imageUrl;
return `${baseUrl}/${imageUrl}?rc_uid=${user.id}&rc_token=${user.token}`;
};
const image = getImageUrl();

const onPress = () => openLink(url.url, theme);

Expand Down

0 comments on commit 14e0857

Please sign in to comment.