2019-08-05 14:29:35 +00:00
|
|
|
<template>
|
2022-06-19 00:25:21 +00:00
|
|
|
<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>
|
|
|
|
|
2022-06-19 00:25:21 +00:00
|
|
|
<script lang="ts">
|
|
|
|
import {defineComponent, onMounted} from "vue";
|
2019-11-16 17:24:03 +00:00
|
|
|
import socket from "../js/socket";
|
2022-06-19 00:25:21 +00:00
|
|
|
import {useStore} from "../js/store";
|
2019-08-05 14:29:35 +00:00
|
|
|
|
2022-06-19 00:25:21 +00:00
|
|
|
export default defineComponent({
|
2019-08-05 14:29:35 +00:00
|
|
|
name: "VersionChecker",
|
2022-06-19 00:25:21 +00:00
|
|
|
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");
|
2022-06-19 00:25:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
if (!store.state.versionData) {
|
|
|
|
checkNow();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return {
|
|
|
|
store,
|
|
|
|
checkNow,
|
|
|
|
};
|
2019-08-05 14:29:35 +00:00
|
|
|
},
|
2022-06-19 00:25:21 +00:00
|
|
|
});
|
2019-08-05 14:29:35 +00:00
|
|
|
</script>
|