Skip to content

Commit

Permalink
live view: remove disabled -OnBattery-specifc views from DOM (#372)
Browse files Browse the repository at this point in the history
instead of hiding views, we can also avoid adding them to the DOM. this
has a couple of advantages:

* no HTTP request for data is sent and no websocket connection is
  established for disabled features.
* JavaScript that causes errors due to incomplete or incompatible data
  of features that are disabled anyways do not trigger the browser
  debugger.
  • Loading branch information
schlimmchen authored Aug 10, 2023
1 parent 1100f10 commit b721416
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions webapp/src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,9 @@
</div>
</div>
</div>
<VedirectView v-show="liveData.vedirect.enabled" />
<div v-show="liveData.battery.enabled" >
<BatteryView/>
</div>
<div v-show="liveData.huawei.enabled" >
<HuaweiView/>
</div>
<VedirectView v-if="liveData.vedirect.enabled" />
<BatteryView v-if="liveData.battery.enabled" />
<HuaweiView v-if="liveData.huawei.enabled" />
</BasePage>
<div class="modal" id="eventView" tabindex="-1">
Expand Down

0 comments on commit b721416

Please sign in to comment.