mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 10:15:43 +03:00
Simplifie code
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
3e97847e7d
commit
d7b10e2ff4
1 changed files with 1 additions and 6 deletions
|
@ -457,12 +457,7 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
|
|||
// trim the range as we want it to exclude leading/trailing spaces
|
||||
selectionRange.trim();
|
||||
|
||||
if (SURROUND_WITH_CHARACTERS.includes(event.key)) {
|
||||
this.historyManager.ensureLastChangesPushed(this.props.model);
|
||||
this.modifiedFlag = true;
|
||||
toggleInlineFormat(selectionRange, event.key);
|
||||
handled = true;
|
||||
} else if ([...SURROUND_WITH_DOUBLE_CHARACTERS.keys()].includes(event.key)) {
|
||||
if ([...SURROUND_WITH_DOUBLE_CHARACTERS.keys(), ...SURROUND_WITH_CHARACTERS].includes(event.key)) {
|
||||
this.historyManager.ensureLastChangesPushed(this.props.model);
|
||||
this.modifiedFlag = true;
|
||||
toggleInlineFormat(selectionRange, event.key, SURROUND_WITH_DOUBLE_CHARACTERS.get(event.key));
|
||||
|
|
Loading…
Reference in a new issue