Line data Source code
1 2355 : let skipNextPrompt = false
2 :
3 : /** Lets the next unload skip the leave prompt; the result takes that back. */
4 0 : export function skipLeavePromptOnce(): () => void {
5 0 : skipNextPrompt = true
6 0 : return () => {
7 0 : skipNextPrompt = false
8 : }
9 : }
10 :
11 : /** True once after `skipLeavePromptOnce`, for the unload it allowed. */
12 0 : export function takeLeavePromptSkip(): boolean {
13 0 : const skip = skipNextPrompt
14 0 : skipNextPrompt = false
15 0 : return skip
16 : }
|