|
324 | 324 | } ); |
325 | 325 | }; |
326 | 326 |
|
327 | | - if( data.lowest_sell_order && data.sell_order_summary ) |
| 327 | + if( data.sell_order_summary ) |
328 | 328 | { |
329 | 329 | const sellHeader = document.createElement( 'div' ); |
330 | 330 | sellHeader.className = 'steamdb_orders_header steamdb_sell_summary'; |
331 | | - sellHeader.dataset.price = data.lowest_sell_order.toString(); |
332 | 331 | sellHeader.innerHTML = data.sell_order_summary; |
333 | | - BindSellButton( sellHeader ); |
| 332 | + |
| 333 | + if( data.lowest_sell_order ) |
| 334 | + { |
| 335 | + sellHeader.dataset.price = data.lowest_sell_order.toString(); |
| 336 | + BindSellButton( sellHeader ); |
| 337 | + } |
| 338 | + |
334 | 339 | orderHeaderSummaries.append( sellHeader ); |
335 | 340 | } |
336 | 341 |
|
337 | | - if( data.highest_buy_order && data.buy_order_summary ) |
| 342 | + if( data.buy_order_summary ) |
338 | 343 | { |
339 | 344 | const buyHeader = document.createElement( 'div' ); |
340 | 345 | buyHeader.className = 'steamdb_orders_header steamdb_buy_summary'; |
341 | | - buyHeader.dataset.price = data.highest_buy_order.toString(); |
342 | 346 | buyHeader.innerHTML = data.buy_order_summary; |
343 | | - BindSellButton( buyHeader ); |
| 347 | + |
| 348 | + if( data.highest_buy_order ) |
| 349 | + { |
| 350 | + buyHeader.dataset.price = data.highest_buy_order.toString(); |
| 351 | + BindSellButton( buyHeader ); |
| 352 | + } |
| 353 | + |
344 | 354 | orderHeaderSummaries.append( buyHeader ); |
345 | 355 | } |
346 | 356 |
|
|
425 | 435 | rows[ 0 ].after( row ); |
426 | 436 | } |
427 | 437 | } |
| 438 | + } |
428 | 439 |
|
429 | | - element.classList.add( 'steamdb_quicksell_visible' ); |
| 440 | + element.classList.add( 'steamdb_quicksell_visible' ); |
430 | 441 |
|
431 | | - const actualHeight = element.offsetHeight; |
| 442 | + const actualHeight = element.offsetHeight; |
432 | 443 |
|
433 | | - if( actualHeight > quickSellHeight ) |
434 | | - { |
435 | | - quickSellHeight = actualHeight; |
436 | | - document.body.style.setProperty( '--steamdb-quick-sell-height', `${actualHeight}px` ); |
437 | | - } |
| 444 | + if( actualHeight > quickSellHeight ) |
| 445 | + { |
| 446 | + quickSellHeight = actualHeight; |
| 447 | + document.body.style.setProperty( '--steamdb-quick-sell-height', `${actualHeight}px` ); |
438 | 448 | } |
439 | 449 | } ) |
440 | 450 | .catch( ( e ) => |
|
0 commit comments