Country selector in the header, auto-detected and remembered
Replaces the left sidebar with a header dropdown (flag + name), like 1xbet's region picker. The shown country resolves as: saved choice (cookie, then the member's profile so it follows them across devices), else Cloudflare's CF-IPCountry (Canada maps to Québec), else Québec. favoriteCountry becomes nullable so geo-detection isn't overridden by a default nobody chose. Emoji flags render as letters on Windows, so flags are now SVGs in /public/flags; country names are in French. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
2eafbfd3d7
commit
e97b2e54ad
@@ -0,0 +1,5 @@
|
||||
-- A member's country preference is only set when they actually pick one,
|
||||
-- so geo-detection isn't overridden by a default nobody chose.
|
||||
ALTER TABLE "User" ALTER COLUMN "favoriteCountry" DROP NOT NULL;
|
||||
ALTER TABLE "User" ALTER COLUMN "favoriteCountry" DROP DEFAULT;
|
||||
UPDATE "User" SET "favoriteCountry" = NULL WHERE "favoriteCountry" = 'CA-QC';
|
||||
@@ -23,8 +23,9 @@ model User {
|
||||
/// (leaderboard, follow counts). Must be set before a member appears
|
||||
/// publicly.
|
||||
publicNickname String?
|
||||
/// Last country tab the member viewed, restored on next visit.
|
||||
favoriteCountry String @default("CA-QC")
|
||||
/// Country the member explicitly picked in the header selector — synced
|
||||
/// across devices. Null until they pick one, so geo-detection applies.
|
||||
favoriteCountry String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
|
||||
Reference in New Issue
Block a user