Skip to content

Commit 7bf0bfb

Browse files
committed
fix:Multiple image attachments in one message do not work correctly RocketChat#5942
1 parent f12e9eb commit 7bf0bfb

File tree

51 files changed

+320
-327
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+320
-327
lines changed

.detoxrc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ module.exports = {
1919
type: 'ios.app',
2020
binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/Rocket.Chat Experimental.app',
2121
build:
22-
'xcodebuild -workspace ios/RocketChatRN.xcworkspace -scheme RocketChatRN -configuration Debug -destination \'generic/platform=iphonesimulator\' -derivedDataPath ios/build'
22+
"xcodebuild -workspace ios/RocketChatRN.xcworkspace -scheme RocketChatRN -configuration Debug -destination 'generic/platform=iphonesimulator' -derivedDataPath ios/build"
2323
},
2424
'ios.release': {
2525
type: 'ios.app',
2626
binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/Rocket.Chat Experimental.app',
2727
build:
28-
'xcodebuild -workspace ios/RocketChatRN.xcworkspace -scheme RocketChatRN -configuration Release -destination \'generic/platform=iphonesimulator\' -derivedDataPath ios/build'
28+
"xcodebuild -workspace ios/RocketChatRN.xcworkspace -scheme RocketChatRN -configuration Release -destination 'generic/platform=iphonesimulator' -derivedDataPath ios/build"
2929
},
3030
'android.debug': {
3131
type: 'android.apk',

android/app/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ android {
9393
minSdkVersion rootProject.ext.minSdkVersion
9494
targetSdkVersion rootProject.ext.targetSdkVersion
9595
versionCode VERSIONCODE as Integer
96-
versionName "4.56.0"
96+
versionName "4.55.0"
9797
vectorDrawables.useSupportLibrary = true
9898
if (!isFoss) {
9999
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]

app/containers/ActionSheet/BottomSheetContent.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ const BottomSheetContent = React.memo(({ options, hasCancel, hide, children, onL
2828
<Touch
2929
onPress={hide}
3030
style={[styles.button, { backgroundColor: colors.surfaceHover }]}
31-
accessibilityLabel={I18n.t('Cancel')}
32-
>
31+
accessibilityLabel={I18n.t('Cancel')}>
3332
<Text style={[styles.text, { color: colors.fontDefault }]}>{I18n.t('Cancel')}</Text>
3433
</Touch>
3534
) : null;

app/containers/Chip/index.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ const Chip = ({ avatar, text, onPress, testID, style }: IChip) => {
5757
onPress={() => onPress?.()}
5858
android_ripple={{
5959
color: colors.surfaceNeutral
60-
}}
61-
>
60+
}}>
6261
<View style={styles.container}>
6362
{avatar ? <Avatar text={avatar} size={28} style={styles.avatar} /> : null}
6463
<View style={styles.textContainer}>

app/containers/CollapsibleText/index.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,13 @@ const CollapsibleText = ({ msg, style = [], linesToTruncate = 1 }: ICollapsibleT
6767
} else {
6868
setShowTruncated(false);
6969
}
70-
}}
71-
>
70+
}}>
7271
{m}
7372
{truncatedText ? (
7473
<Text
7574
testID='collapsible-text-show-less'
7675
onPress={() => setShowTruncated(true)}
77-
style={[styles.textInfo, { color: colors.fontHint }]}
78-
>
76+
style={[styles.textInfo, { color: colors.fontHint }]}>
7977
{` ${I18n.t('Show_less')}`}
8078
</Text>
8179
) : null}

app/containers/EmojiPicker/Footer.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ const Footer = ({ onSearchPressed, onBackspacePressed }: IFooterProps): React.Re
1818
styles.footerButtonsContainer,
1919
{ backgroundColor: isIOS && pressed ? colors.buttonBackgroundSecondaryPress : 'transparent' }
2020
]}
21-
testID='emoji-picker-search'
22-
>
21+
testID='emoji-picker-search'>
2322
<CustomIcon size={24} name='search' />
2423
</Pressable>
2524

@@ -30,8 +29,7 @@ const Footer = ({ onSearchPressed, onBackspacePressed }: IFooterProps): React.Re
3029
styles.footerButtonsContainer,
3130
{ backgroundColor: isIOS && pressed ? colors.buttonBackgroundSecondaryPress : 'transparent' }
3231
]}
33-
testID='emoji-picker-backspace'
34-
>
32+
testID='emoji-picker-backspace'>
3533
<CustomIcon size={24} name='backspace' />
3634
</Pressable>
3735
</View>

app/containers/InAppNotification/IncomingCallNotification/index.tsx

+4-8
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ const IncomingCallHeader = React.memo(
4949
{
5050
marginTop: insets.top
5151
}
52-
]}
53-
>
52+
]}>
5453
<CallHeader
5554
title={i18n.t('Incoming_call_from')}
5655
cam={cam}
@@ -69,8 +68,7 @@ const IncomingCallHeader = React.memo(
6968
setAudio(!audio);
7069
hideNotification();
7170
}}
72-
style={styles.closeButton}
73-
>
71+
style={styles.closeButton}>
7472
<CustomIcon name='close' size={20} />
7573
</Touchable>
7674
<Touchable
@@ -80,8 +78,7 @@ const IncomingCallHeader = React.memo(
8078
hideNotification();
8179
dispatch(cancelCall({ callId }));
8280
}}
83-
style={styles.cancelButton}
84-
>
81+
style={styles.cancelButton}>
8582
<Text style={styles.buttonText}>{i18n.t('decline')}</Text>
8683
</Touchable>
8784
<Touchable
@@ -91,8 +88,7 @@ const IncomingCallHeader = React.memo(
9188
hideNotification();
9289
dispatch(acceptCall({ callId }));
9390
}}
94-
style={styles.acceptButton}
95-
>
91+
style={styles.acceptButton}>
9692
<Text style={styles.buttonText}>{i18n.t('accept')}</Text>
9793
</Touchable>
9894
</View>

app/containers/LoginServices/ButtonService.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ const ButtonService = ({ name, authType, onPress, backgroundColor, buttonText, i
1818
activeOpacity={0.5}
1919
underlayColor={colors.fontWhite}
2020
accessible
21-
accessibilityLabel={accessibilityLabel}
22-
>
21+
accessibilityLabel={accessibilityLabel}>
2322
<View style={styles.serviceButtonContainer}>
2423
{authType === 'oauth' || authType === 'apple' ? <CustomIcon name={icon} size={24} style={styles.serviceIcon} /> : null}
2524
<Text style={[styles.serviceText, { color: colors.fontTitlesLabels }]}>{buttonText}</Text>

app/containers/MessageComposer/components/EmojiSearchbar.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ export const EmojiSearchbar = (): React.ReactElement | null => {
6464
style={({ pressed }: { pressed: boolean }) => [styles.backButton, { opacity: pressed ? 0.7 : 1 }]}
6565
onPress={openEmojiKeyboard}
6666
hitSlop={BUTTON_HIT_SLOP}
67-
testID='openback-emoji-keyboard'
68-
>
67+
testID='openback-emoji-keyboard'>
6968
<CustomIcon name='chevron-left' size={24} />
7069
</Pressable>
7170
<View style={styles.inputContainer}>

app/containers/Passcode/Base/Button.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ const Button = React.memo(({ style, text, disabled, onPress, icon }: IPasscodeBu
2525
underlayColor={colors.buttonBackgroundSecondaryDefault}
2626
rippleColor={colors.buttonBackgroundSecondaryPress}
2727
enabled={!disabled}
28-
onPress={press}
29-
>
28+
onPress={press}>
3029
{icon ? (
3130
<CustomIcon name={icon} size={36} />
3231
) : (

app/containers/RoomItem/Actions.tsx

+4-8
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ export const LeftActions = React.memo(({ transX, isRead, width, onToggleReadPres
3939
{ width: width * 2, backgroundColor: colors.badgeBackgroundLevel2, right: '100%' },
4040
viewHeight,
4141
animatedStyles
42-
]}
43-
>
42+
]}>
4443
<View style={[styles.actionLeftButtonContainer, viewHeight]}>
4544
<RectButton style={styles.actionButton} onPress={onToggleReadPress}>
4645
<CustomIcon
@@ -123,8 +122,7 @@ export const RightActions = React.memo(({ transX, favorite, width, toggleFav, on
123122
},
124123
viewHeight,
125124
animatedFavStyles
126-
]}
127-
>
125+
]}>
128126
<RectButton style={[styles.actionButton, { backgroundColor: colors.statusFontWarning }]} onPress={toggleFav}>
129127
<CustomIcon
130128
size={isCondensed ? CONDENSED_ICON_SIZE : EXPANDED_ICON_SIZE}
@@ -143,12 +141,10 @@ export const RightActions = React.memo(({ transX, favorite, width, toggleFav, on
143141
},
144142
isCondensed && { height: ROW_HEIGHT_CONDENSED },
145143
animatedHideStyles
146-
]}
147-
>
144+
]}>
148145
<RectButton
149146
style={[styles.actionButton, { backgroundColor: colors.buttonBackgroundSecondaryPress }]}
150-
onPress={onHidePress}
151-
>
147+
onPress={onHidePress}>
152148
<CustomIcon
153149
size={isCondensed ? CONDENSED_ICON_SIZE : EXPANDED_ICON_SIZE}
154150
name='unread-on-top-disabled'

app/containers/RoomItem/Touchable.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,7 @@ const Touchable = ({
224224
testID={testID}
225225
style={{
226226
backgroundColor: isFocused ? colors.surfaceTint : colors.surfaceRoom
227-
}}
228-
>
227+
}}>
229228
{children}
230229
</Touch>
231230
</Animated.View>

app/containers/SearchBox/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const SearchBox = ({ onChangeText, onSubmitEditing, testID }: TextInputProps): J
2323
}, []);
2424

2525
return (
26-
<View testID='searchbox' style={{ backgroundColor: colors.surfaceRoom }} >
26+
<View testID='searchbox' style={{ backgroundColor: colors.surfaceRoom }}>
2727
<FormTextInput
2828
autoCapitalize='none'
2929
autoCorrect={false}

app/containers/ThreadDetails.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ const ThreadDetails = ({ item, user, badgeColor, toggleFollowThread, style }: IT
7272
<Text
7373
testID={`thread-count-${count}`}
7474
style={[styles.detailText, { color: themes[theme].fontSecondaryInfo }]}
75-
numberOfLines={1}
76-
>
75+
numberOfLines={1}>
7776
{count}
7877
</Text>
7978
</View>

app/containers/Toast.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const Toast = (): React.ReactElement => {
4646
ref={getToastRef}
4747
position='center'
4848
style={[styles.toast, { backgroundColor: colors.surfaceDark }]}
49-
textStyle={[styles.text, { color: theme === "light" ? colors.fontWhite : colors.fontPureBlack }]}
49+
textStyle={[styles.text, { color: theme === 'light' ? colors.fontWhite : colors.fontPureBlack }]}
5050
opacity={0.9}
5151
/>
5252
);

app/containers/UIKit/DatePicker.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,12 @@ export const DatePicker = ({ element, language, action, context, loading, value,
6565
<Touchable
6666
onPress={() => onShow(!show)}
6767
style={{ backgroundColor: themes[theme].surfaceRoom }}
68-
background={Touchable.Ripple(themes[theme].surfaceNeutral)}
69-
>
68+
background={Touchable.Ripple(themes[theme].surfaceNeutral)}>
7069
<View
71-
style={[styles.input, { borderColor: error ? themes[theme].buttonBackgroundDangerDefault : themes[theme].strokeLight }]}
72-
>
70+
style={[
71+
styles.input,
72+
{ borderColor: error ? themes[theme].buttonBackgroundDangerDefault : themes[theme].strokeLight }
73+
]}>
7374
<Text style={[styles.inputText, { color: error ? themes[theme].fontDanger : themes[theme].fontTitlesLabels }]}>
7475
{currentDate.toLocaleDateString(language)}
7576
</Text>

app/containers/UIKit/MultiSelect/Chips.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ const Chip = ({ item, onSelect, style }: IChip) => {
3131
onPress={() => onSelect(item)}
3232
style={[styles.chip, { backgroundColor: colors.surfaceHover }, style]}
3333
background={Touchable.Ripple(colors.surfaceNeutral)}
34-
testID={`multi-select-chip-${item.value}`}
35-
>
34+
testID={`multi-select-chip-${item.value}`}>
3635
<>
3736
{item.imageUrl ? <FastImage style={styles.chipImage} source={{ uri: item.imageUrl }} /> : null}
3837
<Text numberOfLines={1} style={[styles.chipText, { color: colors.fontTitlesLabels }]}>

app/containers/UIKit/MultiSelect/Input.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ const Input = ({ children, onPress, loading, inputStyle, placeholder, disabled,
2424
onPress={onPress}
2525
style={[{ backgroundColor: colors.surfaceRoom }, styles.inputBorder, inputStyle]}
2626
background={Touchable.Ripple(colors.surfaceNeutral)}
27-
disabled={disabled}
28-
>
27+
disabled={disabled}>
2928
<View style={[styles.input, styles.inputBorder, { borderColor: colors.strokeLight }, innerInputStyle]}>
3029
{placeholder ? <Text style={[styles.pickerText, { color: colors.fontSecondaryInfo }]}>{placeholder}</Text> : children}
3130
{loading ? (

app/containers/UIKit/Overflow.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ const Option = ({ option: { text, value }, onOptionPress, parser, theme }: IOpti
3030
<Touchable
3131
onPress={() => onOptionPress({ value })}
3232
background={Touchable.Ripple(themes[theme].surfaceNeutral)}
33-
style={styles.option}
34-
>
33+
style={styles.option}>
3534
<Text>{parser.text(text)}</Text>
3635
</Touchable>
3736
);
@@ -65,8 +64,7 @@ export const Overflow = ({ element, loading, action, parser }: IOverflow) => {
6564
background={Touchable.Ripple(themes[theme].surfaceNeutral)}
6665
onPress={() => onShow(!show)}
6766
hitSlop={BUTTON_HIT_SLOP}
68-
style={styles.menu}
69-
>
67+
style={styles.menu}>
7068
{!loading ? (
7169
<CustomIcon size={18} name='kebab' color={themes[theme].fontDefault} />
7270
) : (
@@ -78,8 +76,7 @@ export const Overflow = ({ element, loading, action, parser }: IOverflow) => {
7876
// fromView exists in Popover Component
7977
/* @ts-ignore*/
8078
fromView={touchable[blockId]}
81-
onRequestClose={() => onShow(false)}
82-
>
79+
onRequestClose={() => onShow(false)}>
8380
<Options options={options} onOptionPress={onOptionPress} parser={parser} theme={theme} />
8481
</Popover>
8582
</>

app/containers/UIKit/UiKitMessage.stories.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ export default {
4141
onDiscussionPress: () => {},
4242
onReactionLongPress: () => {},
4343
threadBadgeColor: themes.light.fontInfo
44-
}}
45-
>
44+
}}>
4645
<Story />
4746
</MessageContext.Provider>
4847
</ScrollView>

app/containers/UIKit/UiKitModal.stories.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ export default {
4343
onDiscussionPress: () => {},
4444
onReactionLongPress: () => {},
4545
threadBadgeColor: themes.light.fontInfo
46-
}}
47-
>
46+
}}>
4847
<Story />
4948
</MessageContext.Provider>
5049
</ScrollView>

app/containers/markdown/Table.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ const Table = React.memo(({ children, numColumns, theme }: ITable) => {
5555
style={[
5656
styles.containerTable,
5757
{ maxWidth: getTableWidth(), maxHeight: MAX_HEIGHT, borderColor: themes[theme].strokeLight }
58-
]}
59-
>
58+
]}>
6059
{renderRows(false)}
6160
</ScrollView>
6261
<Text style={[styles.textInfo, { color: themes[theme].fontSecondaryInfo }]}>{I18n.t('Full_table')}</Text>

app/containers/message/CallButton.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ const CallButton = React.memo(({ handleEnterCall }: IMessageCallButton) => {
1818
onPress={handleEnterCall}
1919
background={Touchable.Ripple(themes[theme].surfaceNeutral)}
2020
style={[styles.button, { backgroundColor: themes[theme].badgeBackgroundLevel2 }]}
21-
hitSlop={BUTTON_HIT_SLOP}
22-
>
21+
hitSlop={BUTTON_HIT_SLOP}>
2322
<>
2423
<CustomIcon name='camera' size={16} style={styles.buttonIcon} color={themes[theme].fontWhite} />
2524
<Text style={[styles.buttonText, { color: themes[theme].fontWhite }]}>{I18n.t('Click_to_join')}</Text>

0 commit comments

Comments
 (0)