Skip to content

Commit bdf6cc2

Browse files
committed
small fixes in textterm.js
1 parent 516f48b commit bdf6cc2

File tree

1 file changed

+3
-3
lines changed
  • text-io-web/src/main/resources/public-html/textterm

1 file changed

+3
-3
lines changed

text-io-web/src/main/resources/public-html/textterm/textterm.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
var currentLinePromptElem;
8989
var nextTextTermPairIsCurrentLine = true;
9090

91-
var action;
91+
var action = 'NONE';
9292
var oldAction = 'NONE';
9393

9494
var oldInputInnerHtml = '';
@@ -300,13 +300,13 @@
300300
oldInputInnerHtml = '';
301301
}
302302
if(action === 'CONTINUE_READ') {
303-
action = oldAction.startsWith('READ') ? oldAction : 'READ';
303+
action = (oldAction && oldAction.startsWith('READ')) ? oldAction : 'READ';
304304
logDebug('CONTINUE_READ received. Switching to: ' + action);
305305
oldInputInnerHtml = '';
306306
inputElem.setAttribute("contenteditable", true);
307307
inputElem.focus();
308308
}
309-
if(action.startsWith('READ')) {
309+
if(action && action.startsWith('READ')) {
310310
if(oldInputInnerHtml) {
311311
nextTextTermPairIsCurrentLine = true;
312312
createNewTextTermPair("", null, true);

0 commit comments

Comments
 (0)