Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode VERSIONCODE as Integer
versionName "4.66.0"
versionName "4.66.1"
vectorDrawables.useSupportLibrary = true
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
missingDimensionStrategy "RNNotifications.reactNativeVersion", "reactNative60" // See note below!
Expand Down
30 changes: 15 additions & 15 deletions app/containers/message/Urls.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { type ReactElement, useContext, useEffect, useLayoutEffect, useState } from 'react';
import React, { type ReactElement, useCallback, useContext, useEffect, useLayoutEffect, useState } from 'react';
import { StyleSheet, Text, View, type ViewStyle } from 'react-native';
import Clipboard from '@react-native-clipboard/clipboard';
import { Image } from 'expo-image';
Expand Down Expand Up @@ -123,33 +123,33 @@ const Url = ({ url }: { url: IUrl }) => {
const { colors, theme } = useTheme();
const { baseUrl, user } = useContext(MessageContext);
const API_Embed = useAppSelector(state => state.settings.API_Embed);
const [imageUrl, setImageUrl] = useState(url.image);
const [imageUrl, setImageUrl] = useState<string | null>(null);

const getImageUrl = useCallback(() => {
const _imageUrl = url.image || url.url;

if (!_imageUrl) return null;
if (_imageUrl.startsWith('http')) return _imageUrl;
return `${baseUrl}/${_imageUrl}?rc_uid=${user.id}&rc_token=${user.token}`;
}, [url.image, url.url, baseUrl, user.id, user.token]);

useEffect(() => {
const verifyUrlIsImage = async () => {
try {
const imageUrl = getImageUrl();
if (!imageUrl || !API_Embed) return;
const _imageUrl = getImageUrl();
if (!_imageUrl || !API_Embed) return;

const response = await axios.head(imageUrl);
const response = await axios.head(_imageUrl);
const contentType = response.headers['content-type'];
if (contentType?.startsWith?.('image/')) {
setImageUrl(imageUrl);
setImageUrl(_imageUrl);
}
} catch {
// do nothing
}
};
verifyUrlIsImage();
}, [url.image, url.url, API_Embed]);

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}`;
};
}, [url.image, url.url, API_Embed, getImageUrl]);

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

Expand Down
16 changes: 0 additions & 16 deletions app/containers/message/__snapshots__/Message.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -103794,14 +103794,6 @@ exports[`Story Snapshots: URL should match snapshot 1`] = `
}
}
>
<View
style={
{
"flex": 1,
"height": 150,
}
}
/>
<View
style={
{
Expand Down Expand Up @@ -106362,14 +106354,6 @@ exports[`Story Snapshots: URLLargeFont should match snapshot 1`] = `
}
}
>
<View
style={
{
"flex": 1,
"height": 150,
}
}
/>
<View
style={
{
Expand Down
4 changes: 2 additions & 2 deletions ios/RocketChatRN.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3034,7 +3034,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 4.66.0;
MARKETING_VERSION = 4.66.1;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
Expand Down Expand Up @@ -3079,7 +3079,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 4.66.0;
MARKETING_VERSION = 4.66.1;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
PRODUCT_BUNDLE_IDENTIFIER = chat.rocket.reactnative.NotificationService;
Expand Down
2 changes: 1 addition & 1 deletion ios/RocketChatRN/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.66.0</string>
<string>4.66.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/ShareRocketChatRN/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>4.66.0</string>
<string>4.66.1</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>KeychainGroup</key>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rocket-chat-reactnative",
"version": "4.66.0",
"version": "4.66.1",
"private": true,
"packageManager": "yarn@1.22.22",
"scripts": {
Expand Down
Loading