Skip to content

Commit

Permalink
revert channels active state when toggle hilo off
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-TBT committed Sep 12, 2024
1 parent 1408055 commit d49f8cc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/js/views/channel_slider_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,11 @@ var ChannelSliderView = Backbone.View.extend({
if (checkboxState && !m.get("hilo_enabled")){
m.save({
"hilo_enabled": true,
"hilo_original_colors": m.get('channels').map(function(channel) {
return channel.color;
"hilo_channels_state": m.get('channels').map(function(channel) {
return {
"color": channel.color,
"active": channel.active
};
})
});
let foundActive = false;
Expand All @@ -296,7 +299,7 @@ var ChannelSliderView = Backbone.View.extend({
} else if (!checkboxState && m.get("hilo_enabled")){
m.save("hilo_enabled", false);
let newChs = m.get('channels').map(function(channel, idx) {
return {'color': m.get("hilo_original_colors")[idx]};
return m.get("hilo_channels_state")[idx];
});
m.save_channels(newChs);
}
Expand Down

0 comments on commit d49f8cc

Please sign in to comment.