Skip to content

Commit

Permalink
fix #51: multiple market modules not updating correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
selaux committed Jun 9, 2014
1 parent 2b67cda commit 738acf0
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions lib/modules/markets/bitcoincharts.js
Expand Up @@ -4,9 +4,7 @@ var request = require('../../utils/request'),
_ = require('lodash'),

Module = require('../../Module'),
setWithHistoricalData = require('../../utils/setWithHistoricalData'),
intervalTime,
interval;
setWithHistoricalData = require('../../utils/setWithHistoricalData');

module.exports = Module.extend({
defaults: {
Expand All @@ -23,15 +21,9 @@ module.exports = Module.extend({

self.title = self.config.symbol + ' Market @ Bitcoin Charts';

if (interval && self.config.interval < intervalTime) {
clearInterval(interval);
}
if (!interval) {
intervalTime = self.config.interval;
interval = setInterval(function () {
self.updateMarketStats();
}, self.config.interval);
}
self.interval = setInterval(function () {
self.updateMarketStats();
}, self.config.interval);
self.updateMarketStats();
},

Expand Down

0 comments on commit 738acf0

Please sign in to comment.