Show time of edit in message timestamp
This commit is contained in:
parent
7247c2d674
commit
7a512dfbed
2 changed files with 12 additions and 3 deletions
|
@ -127,6 +127,7 @@ import { isSignalConversation } from '../../util/isSignalConversation';
|
||||||
import type { AnyPaymentEvent } from '../../types/Payment';
|
import type { AnyPaymentEvent } from '../../types/Payment';
|
||||||
import { isPaymentNotificationEvent } from '../../types/Payment';
|
import { isPaymentNotificationEvent } from '../../types/Payment';
|
||||||
import { getTitleNoDefault, getNumber } from '../../util/getTitle';
|
import { getTitleNoDefault, getNumber } from '../../util/getTitle';
|
||||||
|
import { getMessageSentTimestamp } from '../../util/getMessageSentTimestamp';
|
||||||
|
|
||||||
export { isIncoming, isOutgoing, isStory };
|
export { isIncoming, isOutgoing, isStory };
|
||||||
|
|
||||||
|
@ -762,7 +763,7 @@ export const getPropsForMessage = (
|
||||||
status: getMessagePropStatus(message, ourConversationId),
|
status: getMessagePropStatus(message, ourConversationId),
|
||||||
text: message.body,
|
text: message.body,
|
||||||
textDirection: getTextDirection(message.body),
|
textDirection: getTextDirection(message.body),
|
||||||
timestamp: message.sent_at,
|
timestamp: getMessageSentTimestamp(message, { includeEdits: true, log }),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -275,7 +275,10 @@ describe('editing', function needsName() {
|
||||||
assert.strictEqual(firstEdit.dataMessage?.body, 'edit message 2');
|
assert.strictEqual(firstEdit.dataMessage?.body, 'edit message 2');
|
||||||
|
|
||||||
debug('opening context menu again');
|
debug('opening context menu again');
|
||||||
await message.locator('[aria-label="More actions"]').click();
|
const firstEditMessage = window.locator(
|
||||||
|
`.module-message[data-testid="${firstEdit.dataMessage?.timestamp?.toNumber()}"]`
|
||||||
|
);
|
||||||
|
await firstEditMessage.locator('[aria-label="More actions"]').click();
|
||||||
|
|
||||||
debug('starting second message edit');
|
debug('starting second message edit');
|
||||||
await window.locator('.module-message__context__edit-message').click();
|
await window.locator('.module-message__context__edit-message').click();
|
||||||
|
@ -295,7 +298,12 @@ describe('editing', function needsName() {
|
||||||
assert.strictEqual(secondEdit.dataMessage?.body, 'edit message 3');
|
assert.strictEqual(secondEdit.dataMessage?.body, 'edit message 3');
|
||||||
|
|
||||||
debug('opening edit history');
|
debug('opening edit history');
|
||||||
await message.locator('.module-message__metadata__edited').click();
|
const secondEditMessage = window.locator(
|
||||||
|
`.module-message[data-testid="${secondEdit.dataMessage?.timestamp?.toNumber()}"]`
|
||||||
|
);
|
||||||
|
await secondEditMessage
|
||||||
|
.locator('.module-message__metadata__edited')
|
||||||
|
.click();
|
||||||
|
|
||||||
const history = await window.locator(
|
const history = await window.locator(
|
||||||
'.EditHistoryMessagesModal .module-message'
|
'.EditHistoryMessagesModal .module-message'
|
||||||
|
|
Loading…
Reference in a new issue