Skip to content

Commit

Permalink
Change default back to zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitri committed Feb 1, 2018
1 parent 2c192f4 commit 6073add
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions component/Bubbles.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function Bubbles(container, self, options) {
typeSpeed = options.typeSpeed || 5 // delay per character, to simulate the machine "typing"
widerBy = options.widerBy || 2 // add a little extra width to bubbles to make sure they don't break
sidePadding = options.sidePadding || 6 // padding on both sides of chat bubbles
recallInteractions = options.recallInteractions || 10 // number of interactions to be remembered and brought back upon restart
recallInteractions = options.recallInteractions || 0 // number of interactions to be remembered and brought back upon restart
inputCallbackFn = options.inputCallbackFn || false // should we display an input field?

var standingAnswer = "ice" // remember where to restart convo if interrupted
Expand All @@ -27,7 +27,7 @@ function Bubbles(container, self, options) {
return false
}
}
var localStorageAvailable = localStorageCheck()
var localStorageAvailable = localStorageCheck() && recallInteractions > 0
var interactionsLS = "chat-bubble-interactions"
var interactionsHistory = localStorageAvailable &&
JSON.parse(localStorage.getItem(interactionsLS)) || []
Expand All @@ -36,7 +36,7 @@ function Bubbles(container, self, options) {
interactionsSave = function(say, reply) {
if(!localStorageAvailable) return
// limit number of saves
if (interactionsHistory.length >= recallInteractions)
if (interactionsHistory.length > recallInteractions)
interactionsHistory.shift() // removes the oldest (first) save to make space

// do not memorize buttons; only user input gets memorized:
Expand Down

0 comments on commit 6073add

Please sign in to comment.