Bug 969511 - Don't update snippets cache unless the update timer fired. r=wesj

This commit is contained in:
Margaret Leibovic 2014-02-07 14:44:38 -08:00
parent a0406ffb0f
commit d492880938

View File

@ -136,9 +136,8 @@ function cacheSnippets(response) {
function loadSnippetsFromCache() {
let promise = OS.File.read(gSnippetsPath);
promise.then(array => updateBanner(gDecoder.decode(array)), e => {
// If snippets.json doesn't exist, update data from the server.
if (e instanceof OS.File.Error && e.becauseNoSuchFile) {
update();
Cu.reportError("Couldn't show snippets because cache does not exist yet.");
} else {
Cu.reportError("Error loading snippets from cache: " + e);
}