@ons/design-system 45.0.1 → 45.0.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.
@@ -6,7 +6,7 @@
6
6
  "classes": "ons-js-timeout-modal",
7
7
  "attributes": {
8
8
  "data-redirect-url": params.redirectUrl,
9
- "data-timeout-time": params.serverTimeoutTime,
9
+ "data-server-session-expires-at": params.sessionExpiresAt,
10
10
  "data-show-modal-time": params.showModalTimeInSeconds,
11
11
  "data-server-session-expiry-endpoint": params.serverSessionExpiryEndpoint,
12
12
  "data-countdown-text": params.countdownText,
@@ -8,7 +8,8 @@ async function modals() {
8
8
 
9
9
  timeouts.forEach(context => {
10
10
  let url = context.getAttribute('data-server-session-expiry-endpoint');
11
- new Timeout(context, url);
11
+ let time = context.getAttribute('data-server-session-expires-at');
12
+ new Timeout(context, url, time);
12
13
  });
13
14
  }
14
15
  }
@@ -34,7 +34,12 @@ export default class Timeout {
34
34
  }
35
35
 
36
36
  async initialise() {
37
- this.expiryTime = await this.setNewExpiryTime();
37
+ if (this.initialExpiryTime && this.sessionExpiryEndpoint) {
38
+ this.expiryTime = this.initialExpiryTime;
39
+ } else {
40
+ this.expiryTime = await this.setNewExpiryTime();
41
+ }
42
+
38
43
  this.expiryTimeInMilliseconds = this.convertTimeToMilliSeconds(this.expiryTime);
39
44
 
40
45
  this.bindEventListeners();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ons/design-system",
3
3
  "description": "ONS Design System built CSS, JS, and Nunjucks templates",
4
- "version": "45.0.1",
4
+ "version": "45.0.2",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
7
7
  "author": {