Ctrl+Click to select message, fix delete pluralization

This commit is contained in:
Jamie Kyle 2023-03-23 14:49:55 -07:00 committed by GitHub
parent 519587450c
commit e819984239
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View file

@ -4656,7 +4656,7 @@
"description": "conversation > in select mode > composition area actions > delete selected messages > confirmation modal > title"
},
"icu:SelectModeActions__confirmDelete--description": {
"messageformat": "This message will be deleted from this device.",
"messageformat": "{count, plural, one {This message} other {These messages}} will be deleted from this device.",
"description": "conversation > in select mode > composition area actions > delete selected messages > confirmation modal > message"
},
"icu:SelectModeActions__confirmDelete--confirm": {

View file

@ -98,6 +98,7 @@ import { Emojify } from './Emojify';
import { getPaymentEventDescription } from '../../messages/helpers';
import { PanelType } from '../../types/Panels';
import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser';
import { isMacOS } from '../../OS';
const GUESS_METADATA_WIDTH_TIMESTAMP_SIZE = 16;
const GUESS_METADATA_WIDTH_EXPIRE_TIMER_SIZE = 18;
@ -2605,6 +2606,15 @@ export class Message extends React.PureComponent<Props, State> {
};
} else {
wrapperProps = {
// We use `onClickCapture` here and preven default/stop propagation to
// prevent other click handlers from firing.
onClickCapture: event => {
if (isMacOS() ? event.metaKey : event.ctrlKey) {
event.preventDefault();
event.stopPropagation();
onToggleSelect(true, false);
}
},
onDoubleClick: event => {
event.stopPropagation();
event.preventDefault();

View file

@ -115,7 +115,9 @@ export default function SelectModeActions({
setConfirmDelete(false);
}}
>
{i18n('icu:SelectModeActions__confirmDelete--description')}
{i18n('icu:SelectModeActions__confirmDelete--description', {
count: selectedMessageIds.length,
})}
</ConfirmationDialog>
)}
</>