Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: mobile breaking on specific room #6127

Draft
wants to merge 14 commits into
base: develop
Choose a base branch
from
12 changes: 6 additions & 6 deletions app/containers/message/Urls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ const UrlImage = ({ image, hasContent }: { image: string; hasContent: boolean })
overflow: 'hidden',
alignItems: 'center',
justifyContent: 'center',
...imageDimensions.width <= 64 && { width: 64 },
...imageDimensions.height <= 64 && { height: 64 }
...(imageDimensions.width <= 64 && { width: 64 }),
...(imageDimensions.height <= 64 && { height: 64 })
};
if (!hasContent) {
containerStyle = {
Expand Down Expand Up @@ -131,10 +131,10 @@ const Url = ({ url }: { url: IUrl }) => {
const { baseUrl, user } = useContext(MessageContext);
const API_Embed = useAppSelector(state => state.settings.API_Embed);
const getImageUrl = () => {
const imageUrl = url.image || url.url;
const imageUrl = url?.image || url?.url;

if (!imageUrl) return null;
if (imageUrl.includes('http')) return imageUrl;
if (imageUrl?.includes('http')) return imageUrl;
return `${baseUrl}/${imageUrl}?rc_uid=${user.id}&rc_token=${user.token}`;
};
const image = getImageUrl();
Expand All @@ -147,8 +147,8 @@ const Url = ({ url }: { url: IUrl }) => {
};

const hasContent = !!(url.title || url.description);

if (!url || url?.ignoreParse || !API_Embed) {
if (!url || url?.ignoreParse || !API_Embed || (!hasContent && image?.includes('.pdf'))) {
console.log('caiu aqui');
return null;
}

Expand Down
1 change: 1 addition & 0 deletions app/lib/methods/subscriptions/rooms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ export default function subscribeRooms() {
const [, ev] = ddpMessage.fields.eventName.split('/');
if (/userData/.test(ev)) {
const [{ diff, unset }] = ddpMessage.fields.args;

if (diff?.emails?.length > 0) {
store.dispatch(setUser({ emails: diff.emails }));
}
Expand Down