()
| 717 | } |
| 718 | |
| 719 | handleStateCheckConditionsUpdate() { |
| 720 | if (!this.stateCheckCanStart) { |
| 721 | this.clearStateCheckTimeout(); |
| 722 | return; |
| 723 | } |
| 724 | if (this.stateCheckTimeoutID) { |
| 725 | return; |
| 726 | } |
| 727 | const { viewer } = this; |
| 728 | if (!viewer) { |
| 729 | return; |
| 730 | } |
| 731 | const timeUntilStateCheck = |
| 732 | viewer.sessionLastValidated + sessionCheckFrequency - Date.now(); |
| 733 | if (timeUntilStateCheck <= 0) { |
| 734 | ignorePromiseRejections(this.initiateStateCheck()); |
| 735 | } else { |
| 736 | this.stateCheckTimeoutID = setTimeout( |
| 737 | this.initiateStateCheck, |
| 738 | timeUntilStateCheck, |
| 739 | ); |
| 740 | } |
| 741 | } |
| 742 | |
| 743 | initiateStateCheck = async () => { |
| 744 | this.setStateCheckConditions({ stateCheckOngoing: true }); |
no test coverage detected