mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
Add function to fetch the newest version of the app & also a popup.
This commit is contained in:
parent
a000a080ed
commit
804694f74c
2 changed files with 49 additions and 0 deletions
|
@ -47,6 +47,9 @@ import { gsap } from "gsap";
|
|||
import confetti from "js-confetti";
|
||||
import translate from "translate";
|
||||
|
||||
// Import Scripts
|
||||
import checkAppVersion from "~/components/checkAppVersion";
|
||||
|
||||
// Import Windows
|
||||
import UserWindow from "~/components/app/windows/user.vue";
|
||||
import SourcesWindow from "~/components/app/windows/sources.vue";
|
||||
|
@ -99,6 +102,7 @@ const applyForTranslation = ref(false);
|
|||
const langPrefDifferent = ref(false);
|
||||
const notLoggedInState = ref(false);
|
||||
const translateProvider = ref("");
|
||||
const newUpdate = ref(false);
|
||||
|
||||
// Key Data
|
||||
const menuItems = [
|
||||
|
@ -620,6 +624,12 @@ onMounted(async () => {
|
|||
translateProvider.value = loadUserInfoData.translate.provider || "google";
|
||||
console.log(langPrefDifferent);
|
||||
});*/
|
||||
|
||||
// Get ghe newest update
|
||||
const newUpdateTimer = 1000 * 60 * 3; // Check for thime every 3 min.
|
||||
setInterval(async () => {
|
||||
newUpdate.value = await checkAppVersion();
|
||||
}, newUpdateTimer);
|
||||
</script>
|
||||
<template>
|
||||
<div v-if="changeLangAnimation">
|
||||
|
@ -745,6 +755,35 @@ onMounted(async () => {
|
|||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
<!--New Update-->
|
||||
<Dialog v-model:open="langPrefDifferent">
|
||||
<DialogContent class="!border-0 !bg-black !rounded">
|
||||
<DialogHeader>
|
||||
<DialogTitle>There is a new Update!</DialogTitle>
|
||||
<DialogDescription>
|
||||
Click notify later to save your current tasks & update the page.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<DialogFooter>
|
||||
<Button
|
||||
@click="
|
||||
() => {
|
||||
newUpdate.value = false;
|
||||
}
|
||||
"
|
||||
variant="outline"
|
||||
>
|
||||
Notify later
|
||||
</Button>
|
||||
<Button
|
||||
@click="() => window.location.reload('/desktop')"
|
||||
variant="outline"
|
||||
>
|
||||
Update
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
<!--Window system-->
|
||||
<Transition>
|
||||
<div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue