From a0b8b4505730d1c789468da1730a20770fbf9ea9 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Wed, 4 Mar 2020 20:37:44 -0500 Subject: [PATCH] Removed metrics API call from non-early-access users --- js/beestat/comparisons.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/js/beestat/comparisons.js b/js/beestat/comparisons.js index 5ecbd57..4c7573b 100644 --- a/js/beestat/comparisons.js +++ b/js/beestat/comparisons.js @@ -35,17 +35,21 @@ beestat.comparisons.get_comparison_scores = function(callback) { ); }); - api.add_call( - 'thermostat_group', - 'get_metrics', - { - 'attributes': beestat.comparisons.get_comparison_attributes('resist') // todo - }, - 'metrics' - ); + if (beestat.user.has_early_access() === true) { + api.add_call( + 'thermostat_group', + 'get_metrics', + { + 'attributes': beestat.comparisons.get_comparison_attributes('resist') // todo + }, + 'metrics' + ); + } api.set_callback(function(data) { - beestat.cache.set('data.metrics', data.metrics); + if (beestat.user.has_early_access() === true) { + beestat.cache.set('data.metrics', data.metrics); + } types.forEach(function(type) { beestat.cache.set('data.comparison_scores_' + type, data['score_' + type]);