@itutoring/itutoring_application_js_api 1.6.1 → 1.6.2

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.
Files changed (2) hide show
  1. package/apiController.js +14 -0
  2. package/package.json +1 -1
package/apiController.js CHANGED
@@ -224,6 +224,12 @@ class APIController
224
224
  resolve(APIController.#R_KEY);
225
225
  }
226
226
 
227
+ if (localStorage.getItem("r_key") !== null)
228
+ {
229
+ APIController.#R_KEY = localStorage.getItem("r_key");
230
+ resolve(APIController.#R_KEY);
231
+ }
232
+
227
233
  // For localhost don't use xml config, but automatically
228
234
  // return test key.
229
235
  if (location.hostname === "localhost")
@@ -240,6 +246,7 @@ class APIController
240
246
  const rKey = rKeyXML.getElementsByTagName("key")[0].childNodes[0].nodeValue;
241
247
 
242
248
  APIController.#R_KEY = rKey;
249
+ localStorage.setItem("r_key", APIController.#R_KEY)
243
250
  resolve(APIController.#R_KEY);
244
251
  });
245
252
  }
@@ -255,6 +262,12 @@ class APIController
255
262
  resolve(APIController.#CLIENT_KEY);
256
263
  }
257
264
 
265
+ if (localStorage.getItem("client_key") !== null)
266
+ {
267
+ APIController.#CLIENT_KEY = localStorage.getItem("client_key");
268
+ resolve(APIController.#CLIENT_KEY);
269
+ }
270
+
258
271
  let keyPath = '/client_key.xml';
259
272
  // For localhost use different xml file (to make suer we won't rewrite the server key when uploading websites)
260
273
  if (location.hostname === "localhost")
@@ -269,6 +282,7 @@ class APIController
269
282
  const key = keyXML.getElementsByTagName("key")[0].childNodes[0].nodeValue;
270
283
 
271
284
  APIController.#CLIENT_KEY = key;
285
+ localStorage.setItem("client_key", APIController.#CLIENT_KEY)
272
286
  resolve(APIController.#CLIENT_KEY);
273
287
  });
274
288
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itutoring/itutoring_application_js_api",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "Javascript API for iTutoring Application",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",