diff --git a/README.md b/README.md index 61af0fb796..f521969ec4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Rocket.Chat Mobile - **Supported server versions:** 0.70.0+ -- **Supported iOS versions**: 12+ +- **Supported iOS versions**: 13.4+ - **Supported Android versions**: 6.0+ ## Download diff --git a/android/app/build.gradle b/android/app/build.gradle index 1e849a36e7..917aa93959 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -93,7 +93,7 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode VERSIONCODE as Integer - versionName "4.50.0" + versionName "4.50.1" vectorDrawables.useSupportLibrary = true if (!isFoss) { manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String] diff --git a/app/containers/MessageComposer/MessageComposer.test.tsx b/app/containers/MessageComposer/MessageComposer.test.tsx index f1326120cd..5cdc418c58 100644 --- a/app/containers/MessageComposer/MessageComposer.test.tsx +++ b/app/containers/MessageComposer/MessageComposer.test.tsx @@ -100,8 +100,10 @@ describe('MessageComposer', () => { const onSendMessage = jest.fn(); render(); expect(screen.getByTestId('message-composer-send-audio')).toBeOnTheScreen(); + expect(screen.queryByTestId('message-composer-send')).not.toBeOnTheScreen(); await user.type(screen.getByTestId('message-composer-input'), 'test'); + expect(screen.getByTestId('message-composer-input')).not.toBe(''); expect(screen.queryByTestId('message-composer-send-audio')).not.toBeOnTheScreen(); expect(screen.getByTestId('message-composer-send')).toBeOnTheScreen(); diff --git a/app/containers/MessageComposer/components/ComposerInput.tsx b/app/containers/MessageComposer/components/ComposerInput.tsx index 0155b08b4e..096f799a84 100644 --- a/app/containers/MessageComposer/components/ComposerInput.tsx +++ b/app/containers/MessageComposer/components/ComposerInput.tsx @@ -12,8 +12,14 @@ import { useSubscription, useAutoSaveDraft } from '../hooks'; import sharedStyles from '../../../views/Styles'; import { useTheme } from '../../../theme'; import { userTyping } from '../../../actions/room'; -import { getRoomTitle, parseJson } from '../../../lib/methods/helpers'; -import { MAX_HEIGHT, MIN_HEIGHT, NO_CANNED_RESPONSES, MARKDOWN_STYLES } from '../constants'; +import { getRoomTitle, isTablet, parseJson } from '../../../lib/methods/helpers'; +import { + MAX_HEIGHT, + MIN_HEIGHT, + NO_CANNED_RESPONSES, + MARKDOWN_STYLES, + COMPOSER_INPUT_PLACEHOLDER_MAX_LENGTH +} from '../constants'; import database from '../../../lib/database'; import Navigation from '../../../lib/navigation/appNavigation'; import { emitter } from '../../../lib/methods/helpers/emitter'; @@ -44,6 +50,9 @@ export const ComposerInput = memo( let placeholder = tmid ? I18n.t('Add_thread_reply') : ''; if (subscription && !tmid) { placeholder = I18n.t('Message_roomname', { roomName: (subscription.t === 'd' ? '@' : '#') + getRoomTitle(subscription) }); + if (!isTablet && placeholder.length > COMPOSER_INPUT_PLACEHOLDER_MAX_LENGTH) { + placeholder = `${placeholder.slice(0, COMPOSER_INPUT_PLACEHOLDER_MAX_LENGTH)}...`; + } } const route = useRoute>(); const usedCannedResponse = route.params?.usedCannedResponse; @@ -143,7 +152,8 @@ export const ComposerInput = memo( })); const setInput: TSetInput = (text, selection) => { - textRef.current = text; + const message = text.trim(); + textRef.current = message; if (inputRef.current) { inputRef.current.setNativeProps({ text }); } @@ -154,7 +164,7 @@ export const ComposerInput = memo( selectionRef.current = selection; }, 50); } - setMicOrSend(text.length === 0 ? 'mic' : 'send'); + setMicOrSend(message.length === 0 ? 'mic' : 'send'); }; const focus = () => { diff --git a/app/containers/MessageComposer/constants.ts b/app/containers/MessageComposer/constants.ts index df87bdd675..c35268c42e 100644 --- a/app/containers/MessageComposer/constants.ts +++ b/app/containers/MessageComposer/constants.ts @@ -35,3 +35,5 @@ export const MARKDOWN_STYLES: Record = { code: '`', 'code-block': '```' }; + +export const COMPOSER_INPUT_PLACEHOLDER_MAX_LENGTH = 30; diff --git a/app/containers/message/Components/Attachments/Image.tsx b/app/containers/message/Components/Attachments/Image.tsx index db0b559828..2fc9cf2ff0 100644 --- a/app/containers/message/Components/Attachments/Image.tsx +++ b/app/containers/message/Components/Attachments/Image.tsx @@ -93,7 +93,6 @@ const ImageContainer = ({ }: IMessageImage): React.ReactElement | null => { const { id, baseUrl, user } = useContext(MessageContext); const [imageCached, setImageCached] = useFile(file, id); - console.log('🚀 ~ imageCached:', id, imageCached); const [cached, setCached] = useState(false); const [loading, setLoading] = useState(true); const { theme } = useTheme(); @@ -107,7 +106,6 @@ const ImageContainer = ({ const handleCache = async () => { if (img) { const isImageCached = await handleGetMediaCache(); - console.log('🚀 ~ handleCache ~ isImageCached:', isImageCached); if (isImageCached) { return; } diff --git a/app/lib/methods/helpers/fileDownload.ts b/app/lib/methods/helpers/fileDownload.ts index 680482a408..5573864e1b 100644 --- a/app/lib/methods/helpers/fileDownload.ts +++ b/app/lib/methods/helpers/fileDownload.ts @@ -24,13 +24,17 @@ export const fileDownload = async (url: string, attachment?: IAttachment, fileNa export const fileDownloadAndPreview = async (url: string, attachment: IAttachment, messageId: string): Promise => { try { - const file = await fileDownload(url, attachment); + let file = url; + // If url starts with file://, we assume it's a local file and we don't download/decrypt it + if (!file.startsWith('file://')) { + file = await fileDownload(file, attachment); - if (attachment.encryption) { - if (!attachment.hashes?.sha256) { - throw new Error('Missing checksum'); + if (attachment.encryption) { + if (!attachment.hashes?.sha256) { + throw new Error('Missing checksum'); + } + await Encryption.addFileToDecryptFileQueue(messageId, file, attachment.encryption, attachment.hashes?.sha256); } - await Encryption.addFileToDecryptFileQueue(messageId, file, attachment.encryption, attachment.hashes?.sha256); } await FileViewer.open(file, { diff --git a/app/lib/methods/sendFileMessage/sendFileMessageV2.ts b/app/lib/methods/sendFileMessage/sendFileMessageV2.ts index 2b776d041e..1f207461cf 100644 --- a/app/lib/methods/sendFileMessage/sendFileMessageV2.ts +++ b/app/lib/methods/sendFileMessage/sendFileMessageV2.ts @@ -18,7 +18,6 @@ export async function sendFileMessageV2( let uploadPath: string | null = ''; let uploadRecord: TUploadModel | null; try { - console.log('sendFileMessage', rid, fileInfo); const { id, token } = user; const headers = { ...RocketChatSettings.customHeaders, diff --git a/app/views/RoomView/List/hooks/useMessages.ts b/app/views/RoomView/List/hooks/useMessages.ts index 4ce8863ab8..738665ce3b 100644 --- a/app/views/RoomView/List/hooks/useMessages.ts +++ b/app/views/RoomView/List/hooks/useMessages.ts @@ -111,7 +111,5 @@ export const useMessages = ({ subscription.current?.unsubscribe(); }; - // console.log(messages[0]); - return [messages, messagesIds, fetchMessages] as const; }; diff --git a/ios/RocketChatRN.xcodeproj/project.pbxproj b/ios/RocketChatRN.xcodeproj/project.pbxproj index 32143d436c..b3e98c2a14 100644 --- a/ios/RocketChatRN.xcodeproj/project.pbxproj +++ b/ios/RocketChatRN.xcodeproj/project.pbxproj @@ -3135,7 +3135,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 4.50.0; + MARKETING_VERSION = 4.50.1; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; @@ -3179,7 +3179,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 4.50.0; + MARKETING_VERSION = 4.50.1; MTL_FAST_MATH = YES; OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; PRODUCT_BUNDLE_IDENTIFIER = chat.rocket.reactnative.NotificationService; diff --git a/ios/RocketChatRN/Info.plist b/ios/RocketChatRN/Info.plist index eaf00d0655..a45e228c7b 100644 --- a/ios/RocketChatRN/Info.plist +++ b/ios/RocketChatRN/Info.plist @@ -28,7 +28,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 4.50.0 + 4.50.1 CFBundleSignature ???? CFBundleURLTypes diff --git a/ios/ShareRocketChatRN/Info.plist b/ios/ShareRocketChatRN/Info.plist index 092a14cd21..76dee41473 100644 --- a/ios/ShareRocketChatRN/Info.plist +++ b/ios/ShareRocketChatRN/Info.plist @@ -26,7 +26,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 4.50.0 + 4.50.1 CFBundleVersion 1 KeychainGroup diff --git a/package.json b/package.json index a0c7ce76d1..b78e3f9eb6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket-chat-reactnative", - "version": "4.50.0", + "version": "4.50.1", "private": true, "scripts": { "start": "react-native start",