File tree Expand file tree Collapse file tree 2 files changed +12
-15
lines changed
frontend/src/app/home/components Expand file tree Collapse file tree 2 files changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -42,13 +42,21 @@ function TradingViewAdvancedChart({
4242 } , [ mappingUrl ] ) ;
4343
4444 const tvSymbol = useMemo ( ( ) => {
45+ const t = ticker ;
46+ if ( typeof t === "string" && t . includes ( ":" ) ) {
47+ const [ ex , sym ] = t . split ( ":" ) ;
48+ const exUpper = ex . toUpperCase ( ) ;
49+ if ( exUpper === "HKEX" ) {
50+ const norm = ( sym ?? "" ) . replace ( / ^ 0 + / , "" ) || "0" ;
51+ return `${ exUpper } :${ norm } ` ;
52+ }
53+ }
4554 const m = symbolMapRef . current ;
46- if ( m && typeof m === "object" && ticker in m ) {
47- const v = m [ ticker ] ;
55+ if ( m && typeof m === "object" && t in m ) {
56+ const v = m [ t ] ;
4857 if ( typeof v === "string" && v . length > 0 ) return v ;
4958 }
50- if ( ticker . includes ( ":" ) ) return ticker ;
51- return ticker ;
59+ return t ;
5260 } , [ ticker , mappingUrl ] ) ;
5361
5462 const containerId = useMemo (
Original file line number Diff line number Diff line change 11{
2- "HKEX:00700" : " HKEX:700" ,
3- "HKEX:00005" : " HKEX:5" ,
4- "HKEX:00011" : " HKEX:11" ,
5- "HKEX:00001" : " HKEX:1" ,
6- "HKEX:00002" : " HKEX:2" ,
7- "HKEX:03690" : " HKEX:3690" ,
8- "HKEX:09988" : " HKEX:9988" ,
9- "HKEX:09618" : " HKEX:9618" ,
10- "HKEX:09888" : " HKEX:9888" ,
11- "HKEX:02800" : " HKEX:2800" ,
12- "HKEX:03067" : " HKEX:3067" ,
132 "CRYPTO:BTC" : " BINANCE:BTCUSDT" ,
143 "CRYPTO:ETH" : " BINANCE:ETHUSDT" ,
154 "CRYPTO:SOL" : " BINANCE:SOLUSDT" ,
You can’t perform that action at this time.
0 commit comments