-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved versioning information to a separate file
- Loading branch information
1 parent
6f24799
commit b23e01e
Showing
4 changed files
with
40 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
|
||
// Current version number | ||
const currentVersion = "0.0.3"; | ||
|
||
// Changelog HTML | ||
const changelogHTML = ` | ||
Nova versão 0.0.3!<br> | ||
<ul> | ||
<li>Mudança da UI</li> | ||
<li>Suporte para botão voltar atrás nativo (obrigado DanielAgostinho)</li> | ||
<li>Pedidos e error handling melhorados (obrigado rodrigoleitao)</li> | ||
<li>Proxy já não é utilizado no login na API da EMEL (obrigado j0dd)</li> | ||
<li>Melhorias no sistema de navegação (já não utiliza a bússola do dispositivo)</li> | ||
</ul> | ||
`; | ||
|
||
|
||
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); | ||
} |