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() { function loadSnippetsFromCache() {
let promise = OS.File.read(gSnippetsPath); let promise = OS.File.read(gSnippetsPath);
promise.then(array => updateBanner(gDecoder.decode(array)), e => { 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) { if (e instanceof OS.File.Error && e.becauseNoSuchFile) {
update(); Cu.reportError("Couldn't show snippets because cache does not exist yet.");
} else { } else {
Cu.reportError("Error loading snippets from cache: " + e); Cu.reportError("Error loading snippets from cache: " + e);
} }