feat: hide country toggle

This commit is contained in:
Raymond
2026-06-07 00:18:20 -04:00
parent 898939485c
commit 4b5eeadc2b
6 changed files with 20 additions and 2 deletions

View File

@@ -156,6 +156,16 @@
</label>
</div>
</div>
<div class="field m-t">
<div class="bool">
<input id="hideCountry" type="checkbox" bind:checked={me.hideCountry}
on:change={() => submit('hideCountry', me.hideCountry.toString())}/>
<label for="hideCountry">
<span class="name">{ts(`settings.fields.hideCountry.name`)}</span>
<span class="desc">{ts(`settings.fields.hideCountry.desc`)}</span>
</label>
</div>
</div>
<div class="field m-t">
<div>
<button on:click={logOut}>{ts(`settings.profile.logout`)}</button>

View File

@@ -244,6 +244,8 @@ export const EN_REF_SETTINGS = {
'settings.fields.gameUsername.desc': 'Your name shown in game',
'settings.fields.optOutOfLeaderboard.name': 'Opt Out of Leaderboard',
'settings.fields.optOutOfLeaderboard.desc': 'You will still be able to see yourself on the leaderboard after logging in',
'settings.fields.hideCountry.name': 'Hide Country',
'settings.fields.hideCountry.desc': 'Your country of registration will not be visible on your profile',
'settings.fields.enableMusicRank.name': 'Enable Recommended Music Rank on Your Machine',
'settings.fields.enableMusicRank.desc': 'If you have your own ranking, you can turn this off. It only affects your own machine',
'settings.profile.picture': 'Profile Picture',

View File

@@ -256,6 +256,8 @@ const zhSettings: typeof EN_REF_SETTINGS = {
'settings.fields.gameUsername.desc': '在游戏中显示的用户名',
'settings.fields.optOutOfLeaderboard.name': '不参与排行榜',
'settings.fields.optOutOfLeaderboard.desc': '登录之后还是可以在排行榜上看到自己',
"settings.fields.hideCountry.name": "隐藏注册国家",
"settings.fields.hideCountry.desc": "您的注册国家不会在个人资料中显示",
'settings.fields.enableMusicRank.name': '在你的机台上启用「推荐乐曲排行榜」',
'settings.fields.enableMusicRank.desc': '如果你自己设计了排行榜的话,可以关闭这个(会影响你自己的机器)。',
'settings.profile.picture': '头像',

View File

@@ -325,5 +325,5 @@ class UserRegistrar(
}
SUCCESS
}
}
}

View File

@@ -63,6 +63,7 @@ class AquaNetUser(
var profileBio: String? = "",
var profilePicture: String? = "",
var optOutOfLeaderboard: Boolean = false,
var hideCountry: Boolean = false,
// Email confirmation
var emailConfirmed: Boolean = false,
@@ -97,7 +98,7 @@ class AquaNetUser(
val publicFields get() = mapOf(
"username" to username,
"displayName" to displayName,
"country" to country,
"country" to if (hideCountry) "" else country,
"regTime" to regTime,
"profileLocation" to profileLocation,
"profileBio" to profileBio,
@@ -264,4 +265,5 @@ class AquaUserServices(
}
fun checkOptOutOfLeaderboard(optOutOfLeaderboard: Str) = optOutOfLeaderboard.toBoolean()
fun checkHideCountry(hideCountry: Str) = hideCountry.toBoolean()
}

View File

@@ -0,0 +1,2 @@
ALTER TABLE `aqua_net_user`
ADD COLUMN IF NOT EXISTS `hide_country` bit NOT NULL DEFAULT b'0';