Skip to content

Commit

Permalink
Merge branch 'develop' into fix-thumb-url-big
Browse files Browse the repository at this point in the history
  • Loading branch information
OtavioStasiak authored Oct 25, 2024
2 parents ada0c29 + 85f6099 commit dcd2599
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 4 deletions.
4 changes: 3 additions & 1 deletion app/containers/MessageComposer/components/ComposerInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion app/containers/markdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,13 @@ class Markdown extends PureComponent<IMarkdownProps, any> {
};

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 <Text>{children}</Text>;
}
return (
<Text style={[styles.text, { color: themes[theme!].fontDefault }, ...style]} numberOfLines={numberOfLines}>
{children}
Expand Down
1 change: 1 addition & 0 deletions app/containers/markdown/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default StyleSheet.create({
...sharedStyles.textRegular
},
textBig: {
lineHeight: 43,
fontSize: 30,
...sharedStyles.textRegular
},
Expand Down
2 changes: 1 addition & 1 deletion app/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -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: ",
Expand Down
23 changes: 22 additions & 1 deletion e2e/tests/room/02-room.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit dcd2599

Please sign in to comment.