@kaspernj/api-maker 1.0.343 → 1.0.345

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  ]
17
17
  },
18
18
  "name": "@kaspernj/api-maker",
19
- "version": "1.0.343",
19
+ "version": "1.0.345",
20
20
  "type": "module",
21
21
  "description": "",
22
22
  "main": "index.js",
@@ -70,7 +70,7 @@
70
70
  "babel-jest": "^29.0.1",
71
71
  "eslint": "^8.2.0",
72
72
  "eslint-find-rules": "^4.0.0",
73
- "eslint-plugin-jest": "^27.0.1",
73
+ "eslint-plugin-jest": "^28.2.0",
74
74
  "eslint-plugin-react": "^7.23.2",
75
75
  "i18n-on-steroids": "^1.0.7",
76
76
  "jest": "^29.0.1",
@@ -1,3 +1,4 @@
1
+ import config from "./config.mjs"
1
2
  import Devise from "./devise.mjs"
2
3
  import * as inflection from "inflection"
3
4
  import Logger from "./logger.mjs"
@@ -22,17 +23,23 @@ export default class ApiMakerSessionStatusUpdater {
22
23
  }
23
24
 
24
25
  connectOnlineEvent () {
25
- window.addEventListener("online", () => this.updateSessionStatus(), false)
26
+ window.addEventListener("online", this.updateSessionStatus, false)
26
27
  }
27
28
 
28
29
  connectWakeEvent () {
29
- wakeEvent(() => this.updateSessionStatus())
30
+ wakeEvent(this.updateSessionStatus)
30
31
  }
31
32
 
32
33
  async sessionStatus () {
33
34
  return new Promise((resolve) => {
35
+ const requestPath = ""
36
+
37
+ if (config.getHost()) requestPath += config.getHost()
38
+
39
+ requestPath += "/api_maker/session_statuses"
40
+
34
41
  const xhr = new XMLHttpRequest()
35
- xhr.open("POST", "/api_maker/session_statuses", true)
42
+ xhr.open("POST", requestPath, true)
36
43
  xhr.onload = () => {
37
44
  const response = JSON.parse(xhr.responseText)
38
45
  resolve(response)
@@ -65,7 +72,7 @@ export default class ApiMakerSessionStatusUpdater {
65
72
  clearTimeout(this.updateTimeout)
66
73
  }
67
74
 
68
- async updateSessionStatus () {
75
+ updateSessionStatus = async () => {
69
76
  logger.debug("updateSessionStatus")
70
77
 
71
78
  const result = await this.sessionStatus()