Created
May 26, 2013 13:14
-
-
Save raine/5652753 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| this.listenTo(app.settings, 'change', this.refresh.bind(this, 'cache')); | |
| refresh: function(arg) { | |
| var type; | |
| if (arg === 'cache') { | |
| // HACK: 'change' fires twice on settings when resetting, | |
| // once from resetting to defaults and again from setting the | |
| // topics. This makes sure that refresh is called only once | |
| // when resetting. | |
| if (app.settings.get('topics') === undefined) { | |
| return; | |
| } | |
| type = 'refresh-from-cache'; | |
| } else { | |
| type = 'refresh'; | |
| } | |
| chrome.extension.sendMessage({ | |
| type: type | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment