hardlounge/client/components/VersionChecker.vue

36 lines
670 B
Vue
Raw Permalink Normal View History

2019-08-05 14:29:35 +00:00
<template>
<div id="version-checker" :class="[store.state.versionStatus]">
2023-12-10 04:52:01 +00:00
<p>Check for updates yourself you lazy bum</p>
2019-08-05 14:29:35 +00:00
</div>
</template>
<script lang="ts">
import {defineComponent, onMounted} from "vue";
2019-11-16 17:24:03 +00:00
import socket from "../js/socket";
import {useStore} from "../js/store";
2019-08-05 14:29:35 +00:00
export default defineComponent({
2019-08-05 14:29:35 +00:00
name: "VersionChecker",
setup() {
const store = useStore();
const checkNow = () => {
store.commit("versionData", null);
store.commit("versionStatus", "loading");
2019-08-05 14:29:35 +00:00
socket.emit("changelog");
};
onMounted(() => {
if (!store.state.versionData) {
checkNow();
}
});
return {
store,
checkNow,
};
2019-08-05 14:29:35 +00:00
},
});
2019-08-05 14:29:35 +00:00
</script>