Fix crypto icons

vite2
Alex Gleason 2023-01-18 20:39:08 -06:00
rodzic d900cd0c9c
commit 9c9c86d8f9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 4 dodań i 7 usunięć

Wyświetl plik

@ -1,12 +1,11 @@
import genericIcon from 'cryptocurrency-icons/svg/color/generic.svg';
import React from 'react';
/** Get crypto icon URL by ticker symbol, or fall back to generic icon */
const getIcon = (ticker: string): string => {
try {
return require(`cryptocurrency-icons/svg/color/${ticker.toLowerCase()}.svg`);
} catch {
return require('cryptocurrency-icons/svg/color/generic.svg');
}
const modules: Record<string, any> = import.meta.glob('../../../../../node_modules/cryptocurrency-icons/svg/color/*.svg', { eager: true });
const key = `../../../../../node_modules/cryptocurrency-icons/svg/color/${ticker}.svg`;
return modules[key]?.default || genericIcon;
};
interface ICryptoIcon {

Wyświetl plik

@ -400,8 +400,6 @@ const Thread: React.FC<IThread> = (props) => {
index: ancestorsIds.size,
offset: -80,
});
setImmediate(() => statusRef.current?.querySelector<HTMLDivElement>('.detailed-actualStatus')?.focus());
}, [props.params.statusId, status?.id, ancestorsIds.size, isLoaded]);
const handleRefresh = () => {