Skip to content

Commit

Permalink
webapp: address eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
schlimmchen committed Oct 6, 2024
1 parent b2913f2 commit ee54beb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
8 changes: 6 additions & 2 deletions webapp/src/components/BatteryView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ export default defineComponent({
},
// Send heartbeat packets regularly * 59s Send a heartbeat
heartCheck() {
this.heartInterval && clearTimeout(this.heartInterval);
if (this.heartInterval) {
clearTimeout(this.heartInterval);
}
this.heartInterval = setInterval(() => {
if (this.socket.readyState === 1) {
// Connection status
Expand All @@ -240,7 +242,9 @@ export default defineComponent({
/** To break off websocket Connect */
closeSocket() {
this.socket.close();
this.heartInterval && clearTimeout(this.heartInterval);
if (this.heartInterval) {
clearTimeout(this.heartInterval);
}
this.isFirstFetchAfterConnect = true;
},
},
Expand Down
8 changes: 6 additions & 2 deletions webapp/src/components/HuaweiView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,9 @@ export default defineComponent({
},
// Send heartbeat packets regularly * 59s Send a heartbeat
heartCheck() {
this.heartInterval && clearTimeout(this.heartInterval);
if (this.heartInterval) {
clearTimeout(this.heartInterval);
}
this.heartInterval = setInterval(() => {
if (this.socket.readyState === 1) {
// Connection status
Expand All @@ -371,7 +373,9 @@ export default defineComponent({
/** To break off websocket Connect */
closeSocket() {
this.socket.close();
this.heartInterval && clearTimeout(this.heartInterval);
if (this.heartInterval) {
clearTimeout(this.heartInterval);
}
this.isFirstFetchAfterConnect = true;
},
formatNumber(num: number) {
Expand Down
8 changes: 6 additions & 2 deletions webapp/src/components/VedirectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ export default defineComponent({
},
// Send heartbeat packets regularly * 59s Send a heartbeat
heartCheck() {
this.heartInterval && clearTimeout(this.heartInterval);
if (this.heartInterval) {
clearTimeout(this.heartInterval);
}
this.heartInterval = setInterval(() => {
if (this.socket.readyState === 1) {
// Connection status
Expand All @@ -230,7 +232,9 @@ export default defineComponent({
/** To break off websocket Connect */
closeSocket() {
this.socket.close();
this.heartInterval && clearTimeout(this.heartInterval);
if (this.heartInterval) {
clearTimeout(this.heartInterval);
}
this.isFirstFetchAfterConnect = true;
},
},
Expand Down

0 comments on commit ee54beb

Please sign in to comment.