mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-07 06:27:28 +00:00
change(web): Apply suggestion from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
This commit is contained in:
parent
94e67290e1
commit
21c18a4ca5
1 changed files with 3 additions and 3 deletions
|
|
@ -239,9 +239,9 @@ export class ModelCompositor {
|
|||
// Step 1: re-use the original input Transform as the reversion's Transform.
|
||||
// The Web engine will restore the original state of the context before accepting
|
||||
// and before reverting; all we need to do is put the original keystroke back in place.
|
||||
let reversionTransform: Transform = originalInput ?? { insert: '', deleteLeft: 0, id: suggestion.transform.id };
|
||||
// clone the transform to prevent aliasing
|
||||
reversionTransform = {...reversionTransform};
|
||||
let reversionTransform: Transform = originalInput
|
||||
? { ...originalInput }
|
||||
: { insert: '', deleteLeft: 0, id: suggestion.transform.id };
|
||||
|
||||
// Step 2: building the proper 'displayAs' string for the Reversion
|
||||
const postContext = originalInput ? models.applyTransform(originalInput, context) : context;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue