diff --git a/app/containers/MessageComposer/components/ComposerInput.tsx b/app/containers/MessageComposer/components/ComposerInput.tsx index 378b1729bc..d1a3db21e4 100644 --- a/app/containers/MessageComposer/components/ComposerInput.tsx +++ b/app/containers/MessageComposer/components/ComposerInput.tsx @@ -6,7 +6,7 @@ import { RouteProp, useFocusEffect, useRoute } from '@react-navigation/native'; import I18n from '../../../i18n'; import { IAutocompleteItemProps, IComposerInput, IComposerInputProps, IInputSelection, TSetInput } from '../interfaces'; -import { useAutocompleteParams, useFocused, useMessageComposerApi } from '../context'; +import { useAutocompleteParams, useFocused, useMessageComposerApi, useMicOrSend } from '../context'; import { fetchIsAllOrHere, getMentionRegexp } from '../helpers'; import { useSubscription, useAutoSaveDraft } from '../hooks'; import sharedStyles from '../../../views/Styles'; @@ -58,6 +58,8 @@ export const ComposerInput = memo( const usedCannedResponse = route.params?.usedCannedResponse; const prevAction = usePrevious(action); + // subscribe to changes on mic state to update draft after a message is sent + useMicOrSend(); const { saveMessageDraft } = useAutoSaveDraft(textRef.current); // Draft/Canned Responses diff --git a/app/containers/markdown/index.tsx b/app/containers/markdown/index.tsx index a2b663f415..6b33eb12a8 100644 --- a/app/containers/markdown/index.tsx +++ b/app/containers/markdown/index.tsx @@ -191,10 +191,13 @@ class Markdown extends PureComponent { }; renderParagraph = ({ children }: any) => { - const { numberOfLines, style = [], theme } = this.props; + const { numberOfLines, style = [], theme, msg } = this.props; if (!children || children.length === 0) { return null; } + if (msg && this.isMessageContainsOnlyEmoji) { + return {children}; + } return ( {children} diff --git a/app/containers/markdown/styles.ts b/app/containers/markdown/styles.ts index 232d60d7f1..c03fd66f76 100644 --- a/app/containers/markdown/styles.ts +++ b/app/containers/markdown/styles.ts @@ -46,6 +46,7 @@ export default StyleSheet.create({ ...sharedStyles.textRegular }, textBig: { + lineHeight: 43, fontSize: 30, ...sharedStyles.textRegular }, diff --git a/app/i18n/locales/de.json b/app/i18n/locales/de.json index e899495fe9..81d03d2d10 100644 --- a/app/i18n/locales/de.json +++ b/app/i18n/locales/de.json @@ -740,7 +740,7 @@ "you": "Sie", "You_are_converting_the_team": "Sie wandeln dieses Team in einen Room um", "You_are_deleting_the_team": "Sie sind dabei dieses Team zu löschen.", - "You_are_in_preview_mode": "Sie befinden dich im Vorschaumodus", + "You_are_in_preview_mode": "Sie befinden sich im Vorschaumodus", "You_are_leaving_the_team": "Sie verlassen das Team '{{team}}'", "You_can_search_using_RegExp_eg": "Sie können mit RegExp suchen. z.B. `/ ^ text $ / i`", "You_colon": "Sie: ", diff --git a/e2e/tests/room/02-room.spec.ts b/e2e/tests/room/02-room.spec.ts index 7a38a3c960..20b6ddbec1 100644 --- a/e2e/tests/room/02-room.spec.ts +++ b/e2e/tests/room/02-room.spec.ts @@ -10,7 +10,8 @@ import { TTextMatcher, mockMessage, navigateToRoom, - navigateToRecentRoom + navigateToRecentRoom, + checkMessage } from '../../helpers/app'; import { createRandomRoom, createRandomUser, deleteCreatedUsers, ITestUser, sendMessage } from '../../helpers/data_setup'; import data from '../../data'; @@ -413,6 +414,26 @@ describe('Room screen', () => { await tapBack(); }); + it('should save draft, check it, send it and clear it', async () => { + await navigateToRoom(room); + const draftMessage = 'draft'; + await element(by.id('message-composer-input')).typeText(draftMessage); + await tapBack(); + await navigateToRecentRoom(room); + await sleep(500); // wait for animation + await expect(element(by.id('message-composer-input'))).toHaveText(draftMessage); + await waitFor(element(by.id('message-composer-send'))) + .toExist() + .withTimeout(5000); + await element(by.id('message-composer-send')).tap(); + await checkMessage(draftMessage); + await tapBack(); + await navigateToRecentRoom(room); + await sleep(500); // wait for animation + await expect(element(by.id('message-composer-input'))).toHaveText(''); + await tapBack(); + }); + it('should save message and quote draft correctly', async () => { const newUser = await createRandomUser(); const { name: draftRoom } = await createRandomRoom(newUser, 'c');