Skip to content

Commit

Permalink
Ctrl+Click to select message, fix delete pluralization
Browse files Browse the repository at this point in the history
Co-authored-by: Jamie Kyle <113370520+jamiebuilds-signal@users.noreply.github.com>
  • Loading branch information
automated-signal and jamiebuilds-signal committed Mar 23, 2023
1 parent 9fde097 commit fb8ef42
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _locales/en/messages.json
Expand Up @@ -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": {
Expand Down
10 changes: 10 additions & 0 deletions ts/components/conversation/Message.tsx
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 3 additions & 1 deletion ts/components/conversation/SelectModeActions.tsx
Expand Up @@ -115,7 +115,9 @@ export default function SelectModeActions({
setConfirmDelete(false);
}}
>
{i18n('icu:SelectModeActions__confirmDelete--description')}
{i18n('icu:SelectModeActions__confirmDelete--description', {
count: selectedMessageIds.length,
})}
</ConfirmationDialog>
)}
</>
Expand Down

0 comments on commit fb8ef42

Please sign in to comment.