Skip to content

Commit

Permalink
Update common.js
Browse files Browse the repository at this point in the history
  • Loading branch information
fquirin committed Jan 14, 2024
1 parent 08876ba commit fe557f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/d4/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ function createStoredCalculatorsPopUp(onSelectCallback){
list.className = "list-container";
keys.forEach(function(k){
var cfg = storedConfigs[k];
//filter calc. type
if (cfg.calc && cfg.calc != d4cType){
return;
}
Expand Down Expand Up @@ -409,7 +410,7 @@ function writeConfigToLocalStorage(name, config){
if (!name) name = "Unnamed";
var key = name.replace(/\s+/g, "_").trim().toLowerCase();
key += ("__" + d4cType);
storedData.configurations[key] = {name: name, calc: d4cType, data: config};
storedData.configurations[key] = {name: name, calc: d4cType, version: d4cVersion, data: config};
localStorage.setItem("d4-calc-data", JSON.stringify(storedData));
}catch(err){
showPopUp("Failed to write to localStorage. Error: " + (err.message || err.name || err));
Expand Down

0 comments on commit fe557f9

Please sign in to comment.