feat: display changelog modal on new version to improve awareness (#2403)

## Description:

Following discussion on discord, some people (including me) thought it
would be nice to show the changelog whenever there is a new version, as
people seemed not to be aware of the gameplay change



https://github.com/user-attachments/assets/00b9531d-ea7a-4e69-8a01-64ef3b39536b



## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

sorikairo
This commit is contained in:
Thomas Cruveilher
2025-11-07 15:49:17 -08:00
committed by GitHub
parent aa6d3eba60
commit cde2967ef6
+11
View File
@@ -19,19 +19,30 @@ export class NewsButton extends LitElement {
try { try {
const lastSeenVersion = localStorage.getItem("version"); const lastSeenVersion = localStorage.getItem("version");
this.isActive = lastSeenVersion !== version; this.isActive = lastSeenVersion !== version;
if (this.isActive) {
setTimeout(() => {
this.openNewsModel();
}, 500);
}
} catch (error) { } catch (error) {
// Fallback to NOT showing notification if localStorage fails // Fallback to NOT showing notification if localStorage fails
this.isActive = false; this.isActive = false;
} }
localStorage.setItem("version", version);
} }
private handleClick() { private handleClick() {
localStorage.setItem("version", version); localStorage.setItem("version", version);
this.isActive = false; this.isActive = false;
this.openNewsModel();
}
private openNewsModel() {
const newsModal = document.querySelector("news-modal") as NewsModal; const newsModal = document.querySelector("news-modal") as NewsModal;
if (newsModal) { if (newsModal) {
newsModal.open(); newsModal.open();
} else {
console.log("no newsModal");
} }
} }