mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-24 16:55:24 +03:00
Small bug fixes
Cleaning up some errors in the javascript console before I start adding new ones. src/js/ConfigStorage.js: forgot to test writing multiple keys at once, can now write multiple keys at once. src/js/FirmwareCache.js: avoid throwing an error if someone comes asking for an undefined firmware src/js/jenkins_loader.js: same .error deprecation as #1568
This commit is contained in:
parent
e513c279a4
commit
3ab9097090
3 changed files with 9 additions and 3 deletions
|
@ -42,7 +42,9 @@ var ConfigStorage = {
|
||||||
} else {
|
} else {
|
||||||
//console.log('Abstraction.set',input);
|
//console.log('Abstraction.set',input);
|
||||||
Object.keys(input).forEach(function (element) {
|
Object.keys(input).forEach(function (element) {
|
||||||
window.localStorage.setItem(element, JSON.stringify(input));
|
var tmpObj = {};
|
||||||
|
tmpObj[element] = input[element];
|
||||||
|
window.localStorage.setItem(element, JSON.stringify(tmpObj));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,6 +112,9 @@ let FirmwareCache = (function () {
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
function has(release) {
|
function has(release) {
|
||||||
|
if (!release) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!journalLoaded) {
|
if (!journalLoaded) {
|
||||||
console.warn("Cache not yet loaded");
|
console.warn("Cache not yet loaded");
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -104,9 +104,10 @@ JenkinsLoader.prototype.loadBuilds = function (jobName, callback) {
|
||||||
chrome.storage.local.set(object);
|
chrome.storage.local.set(object);
|
||||||
|
|
||||||
self._parseBuilds(jobUrl, jobName, builds, callback);
|
self._parseBuilds(jobUrl, jobName, builds, callback);
|
||||||
}).error(xhr => {
|
}).fail(xhr => {
|
||||||
GUI.log(i18n.getMessage('buildServerLoadFailed', [jobName, `HTTP ${xhr.status}`]));
|
GUI.log(i18n.getMessage('buildServerLoadFailed', [jobName, `HTTP ${xhr.status}`]));
|
||||||
}).fail(cachedCallback);
|
cachedCallback();
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
cachedCallback();
|
cachedCallback();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue