File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
apps/insights/src/components/LivePrices Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -178,11 +178,18 @@ export const LiveValue = <T extends keyof PriceData>({
178
178
} : LiveValueProps < T > ) => {
179
179
const { current } = useLivePriceData ( cluster , feedKey ) ;
180
180
181
- return current !== undefined || defaultValue !== undefined ? (
182
- ( current ?. [ field ] ?. toString ( ) ?? defaultValue )
183
- ) : (
184
- < Skeleton width = { SKELETON_WIDTH } />
185
- ) ;
181
+ if ( current !== undefined || defaultValue !== undefined ) {
182
+ const value = current ?. [ field ] ;
183
+ if ( typeof value === "string" ) {
184
+ return value ;
185
+ } else if ( typeof value === "number" || typeof value === "bigint" ) {
186
+ return value . toString ( ) ;
187
+ } else {
188
+ return value ? JSON . stringify ( value ) : defaultValue ;
189
+ }
190
+ } else {
191
+ return < Skeleton width = { SKELETON_WIDTH } /> ;
192
+ }
186
193
} ;
187
194
188
195
type LiveComponentValueProps < T extends keyof PriceComponent [ "latest" ] > = {
You can’t perform that action at this time.
0 commit comments