mirror of
https://github.com/mehotkhan/BandersnatchInteractive.git
synced 2025-07-27 17:23:22 +00:00
assets/scripts.js: Log previous persistentState values
This commit is contained in:
parent
9bf91b095b
commit
941c975e36
1 changed files with 3 additions and 2 deletions
|
@ -560,8 +560,9 @@ function choice(choiceIndex) {
|
|||
function applyImpression(impressionData) {
|
||||
if (impressionData && impressionData.type == 'userState') {
|
||||
for (const [variable, value] of Object.entries(impressionData.data.persistent)) {
|
||||
console.log('persistentState set', variable, '=', value);
|
||||
ls["persistentState_" + variable] = JSON.stringify(value);
|
||||
let key = "persistentState_" + variable;
|
||||
console.log('persistentState set', variable, '=', value, '(was', key in ls ? ls[key] : 'unset', ')');
|
||||
ls[key] = JSON.stringify(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue