mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-17 17:09:12 +00:00
Add private lobby ID visibility toggle (#1382)
## Description: Added an eye icon to the lobby ID button so users can hide/show their lobby ID for privacy. When hidden, it shows dots (••••••••) instead of the actual ID. Also added a setting in the user settings to control the default behavior. **Fixes #1091** ### What's new: - Click the eye icon to toggle lobby ID visibility - Global preference in User Settings modal - Creating a new Lobby will take the set preference from User Settings - Copy function still works when hidden    ## 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 - [ ] 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 - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: [UN]nvm
This commit is contained in:
@@ -129,6 +129,14 @@ export class UserSettingModal extends LitElement {
|
||||
console.log("🙈 Anonymous Names:", enabled ? "ON" : "OFF");
|
||||
}
|
||||
|
||||
private toggleLobbyIdVisibility(e: CustomEvent<{ checked: boolean }>) {
|
||||
const hideIds = e.detail?.checked;
|
||||
if (typeof hideIds !== "boolean") return;
|
||||
|
||||
this.userSettings.set("settings.lobbyIdVisibility", !hideIds); // Invert because checked=hide
|
||||
console.log("👁️ Hidden Lobby IDs:", hideIds ? "ON" : "OFF");
|
||||
}
|
||||
|
||||
private toggleLeftClickOpensMenu(e: CustomEvent<{ checked: boolean }>) {
|
||||
const enabled = e.detail?.checked;
|
||||
if (typeof enabled !== "boolean") return;
|
||||
@@ -289,6 +297,15 @@ export class UserSettingModal extends LitElement {
|
||||
@change=${this.toggleAnonymousNames}
|
||||
></setting-toggle>
|
||||
|
||||
<!-- 👁️ Hidden Lobby IDs -->
|
||||
<setting-toggle
|
||||
label="${translateText("user_setting.lobby_id_visibility_label")}"
|
||||
description="${translateText("user_setting.lobby_id_visibility_desc")}"
|
||||
id="lobby-id-visibility-toggle"
|
||||
.checked=${!this.userSettings.get("settings.lobbyIdVisibility", true)}
|
||||
@change=${this.toggleLobbyIdVisibility}
|
||||
></setting-toggle>
|
||||
|
||||
<!-- 🏳️ Territory Patterns -->
|
||||
<setting-toggle
|
||||
label="${translateText("user_setting.territory_patterns_label")}"
|
||||
|
||||
Reference in New Issue
Block a user