Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: move edit action to top of message actions #5917

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions app/containers/MessageActions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,17 @@ const MessageActions = React.memo(
const options: TActionSheetOptionsItem[] = [];
const videoConfBlock = message.t === 'videoconf';

// Edit
const isEditAllowed = allowEdit(message);
if (!videoConfBlock && (isOwn(message) || isEditAllowed)) {
options.push({
title: I18n.t('Edit'),
icon: 'edit',
onPress: () => handleEdit(message.id),
enabled: isEditAllowed
});
}

// Jump to message
const quoteMessageLink = getQuoteMessageLink(message.attachments);
if (quoteMessageLink && jumpToMessage) {
Expand Down Expand Up @@ -455,17 +466,6 @@ const MessageActions = React.memo(
onPress: () => handleShare(message)
});

// Edit
const isEditAllowed = allowEdit(message);
if (!videoConfBlock && (isOwn(message) || isEditAllowed)) {
options.push({
title: I18n.t('Edit'),
icon: 'edit',
onPress: () => handleEdit(message.id),
enabled: isEditAllowed
});
}

// Pin
if (Message_AllowPinning && !videoConfBlock) {
options.push({
Expand Down
1 change: 0 additions & 1 deletion e2e/tests/room/02-room.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ describe('Room screen', () => {
.toExist()
.withTimeout(2000);
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5);
await sleep(300);
await waitFor(element(by[textMatcher]('Edit')))
.toBeVisible()
Expand Down