Skip to content

Commit 60b0e02

Browse files
committed
Web UI: commit webui/src/vendor, which the vendor rule of .gitignore (for Composer) left out
The country picker imports @vendor/emoji: the checkouts of the branch didn't have it, so the typecheck and the build of the web UI failed there, while the working tree that built the committed bundle had it. Claude-Session: https://claude.ai/code/session_01SraUcNBJBJ1Q6tzbqTARiW
1 parent bf93ef5 commit 60b0e02

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,5 @@ woodpecker.lock
163163

164164
# Web UI dependencies
165165
webui/node_modules/
166+
# the vendored code of the web UI (the "vendor" rule above is for Composer)
167+
!webui/src/vendor/

‎webui/src/vendor/emoji/index.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* https://github.com/morethanwords/tweb
3+
* Copyright (C) 2019-2026 Eduard Kuzmenko
4+
* https://github.com/morethanwords/tweb/blob/master/LICENSE
5+
*
6+
* Adapted for MadelineProto: only `getCountryEmoji`, the flag of a country in the country picker.
7+
*/
8+
9+
// Fragment's anonymous numbers have no regional indicators: a gem, as in tweb
10+
const VIRTUAL_COUNTRIES_EMOJIS: Map<string, string> = new Map([
11+
['FT', '\u{1F48E}']
12+
]);
13+
14+
export function getCountryEmoji(iso2: string) {
15+
return VIRTUAL_COUNTRIES_EMOJIS.get(iso2) ??
16+
String.fromCharCode(55356, 56741 + iso2.charCodeAt(0), 55356, 56741 + iso2.charCodeAt(1));
17+
}

0 commit comments

Comments
 (0)