diff --git a/index.html b/index.html
index f1fd84d..26b2e98 100644
--- a/index.html
+++ b/index.html
@@ -57,6 +57,7 @@
+
diff --git a/scripts/stations.js b/scripts/stations.js
index 6bfafd7..364bea0 100644
--- a/scripts/stations.js
+++ b/scripts/stations.js
@@ -75,41 +75,7 @@ async function getStations() {
getUserInformation();
// Check if update info should be shown
- setTimeout(() => {
- // Set the cookie expiry to 1 year after today.
- const expiryDate = new Date();
- expiryDate.setFullYear(expiryDate.getFullYear() + 1);
-
- // Check version to show update notes
- const tempVersion = getCookie("version");
- if (tempVersion) {
- if (tempVersion !== "0.0.3") {
- alert(`
- Nova versão 0.0.3!
-
- - Mudança da UI
- - Suporte para botão voltar atrás nativo (obrigado DanielAgostinho)
- - Pedidos e error handling melhorados (obrigado rodrigoleitao)
- - Proxy já não é utilizado no login na API da EMEL (obrigado j0dd)
- - Melhorias no sistema de navegação (já não utiliza a bússola do dispositivo)
-
- `);
- document.cookie = "version=0.0.3" + "; expires=" + expiryDate.toGMTString();
- }
- } else {
- alert(`
- Nova versão 0.0.3!
-
- - Mudança da UI
- - Suporte para botão voltar atrás nativo (obrigado DanielAgostinho)
- - Pedidos e error handling melhorados (obrigado rodrigoleitao)
- - Proxy já não é utilizado no login na API da EMEL (obrigado j0dd)
- - Melhorias no sistema de navegação (já não utiliza a bússola do dispositivo)
-
- `);
- document.cookie = "version=0.0.3" + "; expires=" + expiryDate.toGMTString();
- }
- }, 2000);
+ showUpdateInfoIfNeeded();
return response.data.getStations;
} else {
diff --git a/scripts/user.js b/scripts/user.js
index 0ae1532..c739312 100644
--- a/scripts/user.js
+++ b/scripts/user.js
@@ -217,7 +217,7 @@ async function openUserSettings() {
-
0.0.3
+
${currentVersion}
Sair
`.trim();
diff --git a/scripts/version.js b/scripts/version.js
new file mode 100644
index 0000000..57c7f7a
--- /dev/null
+++ b/scripts/version.js
@@ -0,0 +1,37 @@
+
+
+// Current version number
+const currentVersion = "0.0.3";
+
+// Changelog HTML
+const changelogHTML = `
+Nova versão 0.0.3!
+
+ - Mudança da UI
+ - Suporte para botão voltar atrás nativo (obrigado DanielAgostinho)
+ - Pedidos e error handling melhorados (obrigado rodrigoleitao)
+ - Proxy já não é utilizado no login na API da EMEL (obrigado j0dd)
+ - Melhorias no sistema de navegação (já não utiliza a bússola do dispositivo)
+
+`;
+
+
+function showUpdateInfoIfNeeded() {
+ setTimeout(() => {
+ // Set the cookie expiry to 1 year after today.
+ const expiryDate = new Date();
+ expiryDate.setFullYear(expiryDate.getFullYear() + 1);
+
+ // Check version to show update notes
+ const userVersion = getCookie("version");
+ if (userVersion) {
+ if (userVersion !== "0.0.3") {
+ alert(changelogHTML);
+ document.cookie = "version=" + currentVersion + "; expires=" + expiryDate.toGMTString();
+ }
+ } else {
+ alert(changelogHTML);
+ document.cookie = "version=" + currentVersion + "; expires=" + expiryDate.toGMTString();
+ }
+ }, 1500);
+}
\ No newline at end of file