()
| 91 | }; |
| 92 | |
| 93 | const restore = () => { |
| 94 | if (stopped) { |
| 95 | return; |
| 96 | } |
| 97 | if (getHistoryEntryKey() !== scrollKey) { |
| 98 | stop(); |
| 99 | return; |
| 100 | } |
| 101 | |
| 102 | const maxScroll = |
| 103 | document.documentElement.scrollHeight - window.innerHeight; |
| 104 | if (maxScroll >= target) { |
| 105 | window.scrollTo(0, target); |
| 106 | expectShellScroll(target); |
| 107 | stop(); |
| 108 | } |
| 109 | }; |
| 110 | |
| 111 | const scheduleRestore = () => { |
| 112 | cancelAnimationFrame(frame); |
no test coverage detected