Skip to content
This repository was archived by the owner on Jan 4, 2021. It is now read-only.

Commit a8ff5f2

Browse files
author
Francois-Xavier Gentilhomme
committed
[FIX] fixes regresion on WS recognition lastIndex
1 parent db843af commit a8ff5f2

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

dist/myscript.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14106,24 +14106,24 @@ MyScript = {
1410614106
* @returns {Promise}
1410714107
*/
1410814108
InkPaper.prototype.recognize = function () {
14109+
var input = this.getComponents().concat(this._components);
1410914110
if (this._selectedRecognizer instanceof scope.AbstractWSRecognizer) {
1411014111
if (this._initialized) {
14111-
var input = this.getComponents().concat(this._components).slice(this._lastSentComponentIndex);
14112-
this._lastSentComponentIndex = input.length;
14112+
var lastInput = input.slice(this._lastSentComponentIndex);
1411314113

14114-
if (input.length > 0) {
14114+
if (lastInput.length > 0) {
14115+
this._lastSentComponentIndex = input.length;
1411514116
if (!this.isStarted) {
1411614117
this.isStarted = true;
14117-
this._selectedRecognizer.startWSRecognition(input);
14118+
this._selectedRecognizer.startWSRecognition(lastInput);
1411814119
} else {
14119-
this._selectedRecognizer.continueWSRecognition(input, this._instanceId);
14120+
this._selectedRecognizer.continueWSRecognition(lastInput, this._instanceId);
1412014121
}
1412114122
} else {
1412214123
this._renderResult();
1412314124
}
1412414125
}
1412514126
} else {
14126-
var input = this.getComponents().concat(this._components);
1412714127
if (this._selectedRecognizer instanceof scope.ShapeRecognizer) {
1412814128
input = this._components.slice(this._lastSentComponentIndex);
1412914129
}

dist/myscript.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/myscript.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/inkPaper.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -617,24 +617,24 @@
617617
* @returns {Promise}
618618
*/
619619
InkPaper.prototype.recognize = function () {
620+
var input = this.getComponents().concat(this._components);
620621
if (this._selectedRecognizer instanceof scope.AbstractWSRecognizer) {
621622
if (this._initialized) {
622-
var input = this.getComponents().concat(this._components).slice(this._lastSentComponentIndex);
623-
this._lastSentComponentIndex = input.length;
623+
var lastInput = input.slice(this._lastSentComponentIndex);
624624

625-
if (input.length > 0) {
625+
if (lastInput.length > 0) {
626+
this._lastSentComponentIndex = input.length;
626627
if (!this.isStarted) {
627628
this.isStarted = true;
628-
this._selectedRecognizer.startWSRecognition(input);
629+
this._selectedRecognizer.startWSRecognition(lastInput);
629630
} else {
630-
this._selectedRecognizer.continueWSRecognition(input, this._instanceId);
631+
this._selectedRecognizer.continueWSRecognition(lastInput, this._instanceId);
631632
}
632633
} else {
633634
this._renderResult();
634635
}
635636
}
636637
} else {
637-
var input = this.getComponents().concat(this._components);
638638
if (this._selectedRecognizer instanceof scope.ShapeRecognizer) {
639639
input = this._components.slice(this._lastSentComponentIndex);
640640
}

0 commit comments

Comments
 (0)