Skip to content

Commit a35becc

Browse files
authored
chore: Merge 4.66.1 into master (#6766)
2 parents c34e462 + f106f3c commit a35becc

File tree

7 files changed

+21
-37
lines changed

7 files changed

+21
-37
lines changed

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ android {
9090
minSdkVersion rootProject.ext.minSdkVersion
9191
targetSdkVersion rootProject.ext.targetSdkVersion
9292
versionCode VERSIONCODE as Integer
93-
versionName "4.66.0"
93+
versionName "4.66.1"
9494
vectorDrawables.useSupportLibrary = true
9595
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
9696
missingDimensionStrategy "RNNotifications.reactNativeVersion", "reactNative60" // See note below!

app/containers/message/Urls.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { type ReactElement, useContext, useEffect, useLayoutEffect, useState } from 'react';
1+
import React, { type ReactElement, useCallback, useContext, useEffect, useLayoutEffect, useState } from 'react';
22
import { StyleSheet, Text, View, type ViewStyle } from 'react-native';
33
import Clipboard from '@react-native-clipboard/clipboard';
44
import { Image } from 'expo-image';
@@ -123,33 +123,33 @@ const Url = ({ url }: { url: IUrl }) => {
123123
const { colors, theme } = useTheme();
124124
const { baseUrl, user } = useContext(MessageContext);
125125
const API_Embed = useAppSelector(state => state.settings.API_Embed);
126-
const [imageUrl, setImageUrl] = useState(url.image);
126+
const [imageUrl, setImageUrl] = useState<string | null>(null);
127+
128+
const getImageUrl = useCallback(() => {
129+
const _imageUrl = url.image || url.url;
130+
131+
if (!_imageUrl) return null;
132+
if (_imageUrl.startsWith('http')) return _imageUrl;
133+
return `${baseUrl}/${_imageUrl}?rc_uid=${user.id}&rc_token=${user.token}`;
134+
}, [url.image, url.url, baseUrl, user.id, user.token]);
127135

128136
useEffect(() => {
129137
const verifyUrlIsImage = async () => {
130138
try {
131-
const imageUrl = getImageUrl();
132-
if (!imageUrl || !API_Embed) return;
139+
const _imageUrl = getImageUrl();
140+
if (!_imageUrl || !API_Embed) return;
133141

134-
const response = await axios.head(imageUrl);
142+
const response = await axios.head(_imageUrl);
135143
const contentType = response.headers['content-type'];
136144
if (contentType?.startsWith?.('image/')) {
137-
setImageUrl(imageUrl);
145+
setImageUrl(_imageUrl);
138146
}
139147
} catch {
140148
// do nothing
141149
}
142150
};
143151
verifyUrlIsImage();
144-
}, [url.image, url.url, API_Embed]);
145-
146-
const getImageUrl = () => {
147-
const _imageUrl = url.image || url.url;
148-
149-
if (!_imageUrl) return null;
150-
if (_imageUrl.includes('http')) return _imageUrl;
151-
return `${baseUrl}/${_imageUrl}?rc_uid=${user.id}&rc_token=${user.token}`;
152-
};
152+
}, [url.image, url.url, API_Embed, getImageUrl]);
153153

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

app/containers/message/__snapshots__/Message.test.tsx.snap

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -103794,14 +103794,6 @@ exports[`Story Snapshots: URL should match snapshot 1`] = `
103794103794
}
103795103795
}
103796103796
>
103797-
<View
103798-
style={
103799-
{
103800-
"flex": 1,
103801-
"height": 150,
103802-
}
103803-
}
103804-
/>
103805103797
<View
103806103798
style={
103807103799
{
@@ -106362,14 +106354,6 @@ exports[`Story Snapshots: URLLargeFont should match snapshot 1`] = `
106362106354
}
106363106355
}
106364106356
>
106365-
<View
106366-
style={
106367-
{
106368-
"flex": 1,
106369-
"height": 150,
106370-
}
106371-
}
106372-
/>
106373106357
<View
106374106358
style={
106375106359
{

ios/RocketChatRN.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3034,7 +3034,7 @@
30343034
"@executable_path/Frameworks",
30353035
"@executable_path/../../Frameworks",
30363036
);
3037-
MARKETING_VERSION = 4.66.0;
3037+
MARKETING_VERSION = 4.66.1;
30383038
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
30393039
MTL_FAST_MATH = YES;
30403040
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
@@ -3079,7 +3079,7 @@
30793079
"@executable_path/Frameworks",
30803080
"@executable_path/../../Frameworks",
30813081
);
3082-
MARKETING_VERSION = 4.66.0;
3082+
MARKETING_VERSION = 4.66.1;
30833083
MTL_FAST_MATH = YES;
30843084
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
30853085
PRODUCT_BUNDLE_IDENTIFIER = chat.rocket.reactnative.NotificationService;

ios/RocketChatRN/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<key>CFBundlePackageType</key>
2929
<string>APPL</string>
3030
<key>CFBundleShortVersionString</key>
31-
<string>4.66.0</string>
31+
<string>4.66.1</string>
3232
<key>CFBundleSignature</key>
3333
<string>????</string>
3434
<key>CFBundleURLTypes</key>

ios/ShareRocketChatRN/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<key>CFBundlePackageType</key>
2727
<string>XPC!</string>
2828
<key>CFBundleShortVersionString</key>
29-
<string>4.66.0</string>
29+
<string>4.66.1</string>
3030
<key>CFBundleVersion</key>
3131
<string>1</string>
3232
<key>KeychainGroup</key>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rocket-chat-reactnative",
3-
"version": "4.66.0",
3+
"version": "4.66.1",
44
"private": true,
55
"packageManager": "[email protected]",
66
"scripts": {

0 commit comments

Comments
 (0)