Skip to content

Commit

Permalink
restore missing livepoll function that got missed during rework
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Nov 15, 2024
1 parent e51efaa commit 9f143a7
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/layouts/MainLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
</template>
<script setup lang="ts">
// composition imports
import { computed, onMounted } from "vue";
import { computed, onMounted, onBeforeUnmount, ref } from "vue";
import { useQuasar } from "quasar";
import { useStore } from "vuex";
import { useDashboardStore } from "@/stores/dashboard";
Expand Down Expand Up @@ -315,8 +315,25 @@ const updateAvailable = computed(() => {
return currentTRMMVersion.value !== latestTRMMVersion.value;
});
const poll = ref(null);
function livePoll() {
poll.value = setInterval(
() => {
store.dispatch("checkVer");
store.dispatch("getDashInfo", false);
},
60 * 4 * 1000,
);
}
onMounted(() => {
store.dispatch("getDashInfo");
store.dispatch("checkVer");
livePoll();
});
onBeforeUnmount(() => {
clearInterval(poll.value);
});
</script>

0 comments on commit 9f143a7

Please sign in to comment.