Skip to content

Commit

Permalink
Move version fetching at the top
Browse files Browse the repository at this point in the history
  • Loading branch information
dinoosauro authored Apr 21, 2024
1 parent 2304a9e commit 801bc6e
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@700&family=Work+Sans&display=swap"
rel="stylesheet">
<link rel="manifest" href="./manifest.json" />
<link rel="apple-touch-icon" href="./icon.png" />
<meta name="apple-mobile-web-app-status-bar" content="#151515" />
<meta name="theme-color" content="#2c8b9b" />
<title>PDFPointer</title>
</head>

<body>
<div id="root"></div>
<script>
if ('serviceWorker' in navigator) {
let registration;
Expand All @@ -24,9 +15,19 @@
};
registerServiceWorker();
}
let appVersion = "2.0.1";
let appVersion = "2.0.2";
fetch("./pdfpointer-updatecode", { cache: "no-store" }).then((res) => res.text().then((text) => { if (text.replace("\n", "") !== appVersion) if (confirm(`There's a new version of pdf-pointer. Do you want to update? [${appVersion} --> ${text.replace("\n", "")}]`)) { caches.delete("pdfpointer-cache"); location.reload(true); } }).catch((e) => { console.error(e) })).catch((e) => console.error(e)); // Check if the application code is the same as the current application version and, if not, ask the user to update
</script>

<link rel="manifest" href="./manifest.json" />
<link rel="apple-touch-icon" href="./icon.png" />
<meta name="apple-mobile-web-app-status-bar" content="#151515" />
<meta name="theme-color" content="#2c8b9b" />
<title>PDFPointer</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>

Expand Down

0 comments on commit 801bc6e

Please sign in to comment.