Background.clearCache() does not nuke the subscription cache.

This commit is contained in:
Kerrick Long
2012-04-29 03:46:51 -05:00
parent 6cb3e84e0f
commit 4f787c67ca
+5
View File
@@ -914,6 +914,7 @@ RedditAPI.prototype.submitLink = function (e, tabId) {
*/
RedditAPI.prototype.getReddits = function () {
reddit.apiTransmit('GET', 'http://' + this.domain + '/reddits/mine.json?app=mh', null, function (response) {
cache.remove('reddits');
cache.set('reddits', response.data.children);
return true;
});
@@ -941,8 +942,12 @@ function Background() {
* @method
*/
Background.prototype.clearCache = function () {
var oldReddits;
oldReddits = cache.get('reddits');
cache.removeAll();
button.setBadgeDefaults();
cache.set('reddits', oldReddits)
};
/**