bugfixing
This commit is contained in:
parent
fc64088ee4
commit
ac5971d679
@ -165,23 +165,19 @@
|
|||||||
const onKeyPress = (e) => {
|
const onKeyPress = (e) => {
|
||||||
if (e?.charCode === 13) {
|
if (e?.charCode === 13) {
|
||||||
focusedSuggestion = "";
|
focusedSuggestion = "";
|
||||||
|
|
||||||
const assetActions = {
|
const assetActions = {
|
||||||
ETF: () => goto(`/etf/${searchQuery}`),
|
ETF: () => goto(`/etf/${searchQuery}`),
|
||||||
Stock: () => goto(`/stocks/${searchQuery}`),
|
Stock: () => goto(`/stocks/${searchQuery}`),
|
||||||
Crypto: () => goto(`/crypto/${searchQuery}`),
|
Crypto: () => goto(`/crypto/${searchQuery}`),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (showSuggestions?.length > 0) {
|
if (searchResults?.length > 0) {
|
||||||
// Use the first search result
|
searchQuery = searchResults.at(0).symbol;
|
||||||
searchQuery = firstResult.symbol;
|
assetType = searchResults.at(0).type;
|
||||||
assetType = firstResult.type;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute the appropriate action for the asset type
|
// Call the function for the selected asset type
|
||||||
if (assetActions[assetType]) {
|
assetActions[assetType]?.();
|
||||||
assetActions[assetType]();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Trigger search bar action
|
// Trigger search bar action
|
||||||
searchBarTicker(searchQuery);
|
searchBarTicker(searchQuery);
|
||||||
|
|||||||
@ -124,8 +124,8 @@
|
|||||||
100
|
100
|
||||||
)?.toFixed(2);
|
)?.toFixed(2);
|
||||||
priceTarget =
|
priceTarget =
|
||||||
data?.getAnalystRating?.priceTarget !== ("n/a" && 0)
|
data?.getAnalystRating?.medianPriceTarget !== ("n/a" && 0)
|
||||||
? data?.getAnalystRating?.priceTarget
|
? data?.getAnalystRating?.medianPriceTarget
|
||||||
: "-";
|
: "-";
|
||||||
consensusRating = data?.getAnalystRating?.consensusRating;
|
consensusRating = data?.getAnalystRating?.consensusRating;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user