Bug 969511 - Don't update snippets cache unless the update timer fired. r=wesj, a=sledru
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Fri, 07 Feb 2014 14:44:38 -0800
changeset 182767 77ba19df83b290f74d7cd40373b93213277e5095
parent 182766 3119a6bb229dd621bf482f8daa6d6854e68bf221
child 182768 1acebd4c891291ce99a49a3fb47b23467caa5990
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj, sledru
bugs969511
milestone29.0a2
Bug 969511 - Don't update snippets cache unless the update timer fired. r=wesj, a=sledru
mobile/android/components/Snippets.js
--- a/mobile/android/components/Snippets.js
+++ b/mobile/android/components/Snippets.js
@@ -131,19 +131,18 @@ function cacheSnippets(response) {
 }
 
 /**
  * Loads snippets from cached `snippets.json`.
  */
 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);
     }
   });
 }
 
 // Array of the message ids added to the home banner, used to remove
 // older set of snippets when new ones are available.