(status: string)
| 649 | } |
| 650 | |
| 651 | private setNotice(status: string): void { |
| 652 | const restore = this.noticeTimeout ? this.noticeRestoreStatus : this.state().status |
| 653 | this.clearNoticeTimer(false) |
| 654 | this.patch({ status }) |
| 655 | if (!status) { |
| 656 | this.noticeRestoreStatus = "" |
| 657 | return |
| 658 | } |
| 659 | |
| 660 | this.noticeRestoreStatus = restore |
| 661 | const version = this.statusVersion |
| 662 | this.noticeTimeout = setTimeout(() => { |
| 663 | this.noticeTimeout = undefined |
| 664 | if (this.isGone || version !== this.statusVersion) { |
| 665 | this.noticeRestoreStatus = "" |
| 666 | return |
| 667 | } |
| 668 | |
| 669 | const next = this.noticeRestoreStatus |
| 670 | this.noticeRestoreStatus = "" |
| 671 | this.patch({ status: next }) |
| 672 | }, NOTICE_DURATION) |
| 673 | } |
| 674 | |
| 675 | private setRequestExitHandler = (fn?: () => boolean): void => { |
| 676 | this.requestExitHandler = fn |
no test coverage detected