steamutils 1.2.22 → 1.2.24

Sign up to get free protection for your applications and to get access to all the features.
package/SteamClient.js CHANGED
@@ -413,9 +413,11 @@ function SteamClient({
413
413
  await sleep(60000)
414
414
  const isSuccess = await relogin(50)
415
415
  if (!isSuccess) {
416
+ offAllEvent()
416
417
  doClearIntervals()
417
418
  }
418
419
  } else {
420
+ offAllEvent()
419
421
  doClearIntervals()
420
422
  }
421
423
  })
@@ -1117,8 +1119,7 @@ function SteamClient({
1117
1119
 
1118
1120
  async function logOff() {
1119
1121
  isLogOff = true
1120
- offAllEvent()
1121
- doClearIntervals()
1122
+
1122
1123
  steamClient.logOff()
1123
1124
  }
1124
1125
 
package/index.js CHANGED
@@ -5961,11 +5961,14 @@ class SteamUser {
5961
5961
  }
5962
5962
  }
5963
5963
 
5964
- async getMarketUnavailable(){
5964
+ async getMarketUnavailable() {
5965
5965
  const response = (await this._httpRequest({
5966
5966
  url: `market`,
5967
5967
  }))?.data
5968
- const $ = cheerio.load(response || '')
5968
+ if (!response) {
5969
+ return null
5970
+ }
5971
+ const $ = cheerio.load(response)
5969
5972
  const market_headertip_container_warning_el = $('.market_headertip_container_warning')
5970
5973
  const market_warning_header_el = market_headertip_container_warning_el.find('#market_warning_header')
5971
5974
  if (market_headertip_container_warning_el.length && market_warning_header_el.length) {
@@ -5973,13 +5976,15 @@ class SteamUser {
5973
5976
  const market_restrictions = []
5974
5977
  market_headertip_container_warning_el.find('ul.market_restrictions > li').each(function () {
5975
5978
  const el = $(this);
5976
- el.find(a).remove()
5979
+ el.find('a').remove()
5977
5980
  market_restrictions.push(el.text()?.trim())
5978
5981
  })
5979
5982
  return {
5980
5983
  market_warning_header,
5981
5984
  market_restrictions,
5982
5985
  }
5986
+ } else {
5987
+ return {}
5983
5988
  }
5984
5989
  }
5985
5990
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.2.22",
3
+ "version": "1.2.24",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.4.0",