mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-17 05:34:37 +00:00
Only open news modal if the user has seen an existing version. This prevents brand new players from seeing the news popup.
Move NewsButton into NewsModal.ts Refactor & simplify NewsButton
This commit is contained in:
+1
-17
@@ -23,7 +23,7 @@ import { LangSelector } from "./LangSelector";
|
||||
import { LanguageModal } from "./LanguageModal";
|
||||
import "./Matchmaking";
|
||||
import { MatchmakingModal } from "./Matchmaking";
|
||||
import { NewsModal } from "./NewsModal";
|
||||
import "./NewsModal";
|
||||
import "./PublicLobby";
|
||||
import { PublicLobby } from "./PublicLobby";
|
||||
import { SinglePlayerModal } from "./SinglePlayerModal";
|
||||
@@ -39,8 +39,6 @@ import {
|
||||
incrementGamesPlayed,
|
||||
isInIframe,
|
||||
} from "./Utils";
|
||||
import "./components/NewsButton";
|
||||
import { NewsButton } from "./components/NewsButton";
|
||||
import "./components/baseComponents/Button";
|
||||
import "./components/baseComponents/Modal";
|
||||
import { getUserMe, isLoggedIn } from "./jwt";
|
||||
@@ -118,20 +116,6 @@ class Client {
|
||||
}
|
||||
gameVersion.innerText = version;
|
||||
|
||||
const newsModal = document.querySelector("news-modal") as NewsModal;
|
||||
if (!newsModal || !(newsModal instanceof NewsModal)) {
|
||||
console.warn("News modal element not found");
|
||||
}
|
||||
const newsButton = document.querySelector("news-button") as NewsButton;
|
||||
if (!newsButton) {
|
||||
console.warn("News button element not found");
|
||||
} else {
|
||||
console.log("News button element found");
|
||||
}
|
||||
|
||||
// Comment out to show news button.
|
||||
// newsButton.hidden = true;
|
||||
|
||||
const langSelector = document.querySelector(
|
||||
"lang-selector",
|
||||
) as LangSelector;
|
||||
|
||||
Reference in New Issue
Block a user