Fix code edior isn't loading old-prefixed solutions
This commit is contained in:
@ -5,6 +5,14 @@ window.common = (function(global) {
|
|||||||
common = { init: [] }
|
common = { init: [] }
|
||||||
} = global;
|
} = global;
|
||||||
|
|
||||||
|
var challengePrefix = [
|
||||||
|
'Bonfire: ',
|
||||||
|
'Waypoint: ',
|
||||||
|
'Zipline: ',
|
||||||
|
'Basejump: ',
|
||||||
|
'Checkpoint: '],
|
||||||
|
item;
|
||||||
|
|
||||||
var codeStorage = {
|
var codeStorage = {
|
||||||
getStoredValue(key) {
|
getStoredValue(key) {
|
||||||
if (
|
if (
|
||||||
@ -16,7 +24,16 @@ window.common = (function(global) {
|
|||||||
console.log('unable to read from storage');
|
console.log('unable to read from storage');
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
if (localStorage.getItem(key + 'Val')) {
|
||||||
return '' + localStorage.getItem(key + 'Val');
|
return '' + localStorage.getItem(key + 'Val');
|
||||||
|
} else {
|
||||||
|
for (var i = 0; i <= challengePrefix.length; i++) {
|
||||||
|
item = localStorage.getItem(challengePrefix[i] + key + 'Val');
|
||||||
|
if (item) {
|
||||||
|
return '' + item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
isAlive: function(key) {
|
isAlive: function(key) {
|
||||||
|
Reference in New Issue
Block a user