From c7fbefcf2e77cfb21e6b965786155d59c242e4f9 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Tue, 4 Jun 2024 20:17:07 -0400 Subject: [PATCH] Fixed clearing temperature profile throwing error when going back to analyze page --- js/component/card/temperature_profiles.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/js/component/card/temperature_profiles.js b/js/component/card/temperature_profiles.js index fa4bbbf..0bd3e11 100644 --- a/js/component/card/temperature_profiles.js +++ b/js/component/card/temperature_profiles.js @@ -91,13 +91,9 @@ beestat.component.card.temperature_profiles.prototype.get_data_ = function() { }; if ( - this.fetching_data_ !== true && - ( - thermostat.profile === null || - moment().diff(moment(thermostat.profile.metadata.generated_at), 'days') >= 7 - ) + thermostat.profile === null || + moment().diff(moment(thermostat.profile.metadata.generated_at), 'days') >= 7 ) { - this.fetching_data_ = true; this.show_loading_('Fetching'); new beestat.api() .add_call( @@ -118,7 +114,6 @@ beestat.component.card.temperature_profiles.prototype.get_data_ = function() { 'thermostat' ) .set_callback(function(response) { - self.fetching_data_ = false; beestat.cache.set('thermostat', response.thermostat); }) .send();