Refine search exchange label fallback

This commit is contained in:
keshav-005 2026-04-23 00:48:24 +05:30
parent 2c193bfacb
commit 80454b9141
1 changed files with 2 additions and 6 deletions

View File

@ -50,7 +50,7 @@ export { fetchJSON };
function getExchangeLabel(symbol: string, exchange?: string) { function getExchangeLabel(symbol: string, exchange?: string) {
if (exchange?.trim()) { if (exchange?.trim()) {
return exchange; return exchange.trim();
} }
const parts = symbol.split('.'); const parts = symbol.split('.');
@ -60,11 +60,7 @@ function getExchangeLabel(symbol: string, exchange?: string) {
return 'US'; return 'US';
} }
if (FINNHUB_EXCHANGE_SUFFIXES.has(suffix) || suffix.length >= 2) { return FINNHUB_EXCHANGE_SUFFIXES.has(suffix) ? suffix : 'US';
return suffix;
}
return 'US';
} }
export async function getQuote(symbol: string) { export async function getQuote(symbol: string) {