@erdemtuna/doc-review 0.11.0 → 0.11.1
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.
- package/lib/frame-controller.js +15 -8
- package/lib/ui/chrome.css +4 -0
- package/lib/ui/chrome.js +1 -1
- package/package.json +1 -1
package/lib/frame-controller.js
CHANGED
|
@@ -9,7 +9,7 @@ export function createFrameController({ sessionId, host, request, suspended, tra
|
|
|
9
9
|
const timers = new Set();
|
|
10
10
|
const flushes = new Map();
|
|
11
11
|
let readinessTimer = null;
|
|
12
|
-
let
|
|
12
|
+
let configurationTimer = null;
|
|
13
13
|
let readinessRetries = 0;
|
|
14
14
|
let initialLoad = false;
|
|
15
15
|
let readyGeneration = null;
|
|
@@ -60,7 +60,7 @@ export function createFrameController({ sessionId, host, request, suspended, tra
|
|
|
60
60
|
for (const timer of timers)
|
|
61
61
|
clearTimer(timer);
|
|
62
62
|
timers.clear();
|
|
63
|
-
readinessTimer =
|
|
63
|
+
readinessTimer = configurationTimer = null;
|
|
64
64
|
state.capability = null;
|
|
65
65
|
state.renderId = null;
|
|
66
66
|
state.execution = null;
|
|
@@ -83,8 +83,8 @@ export function createFrameController({ sessionId, host, request, suspended, tra
|
|
|
83
83
|
return state.generation;
|
|
84
84
|
}
|
|
85
85
|
function finishReplacement() {
|
|
86
|
-
cancelTimer(
|
|
87
|
-
|
|
86
|
+
cancelTimer(configurationTimer);
|
|
87
|
+
configurationTimer = null;
|
|
88
88
|
host.finishReplacement();
|
|
89
89
|
publish();
|
|
90
90
|
}
|
|
@@ -198,9 +198,9 @@ export function createFrameController({ sessionId, host, request, suspended, tra
|
|
|
198
198
|
function configurationTimeout() {
|
|
199
199
|
if (!host.previous)
|
|
200
200
|
return;
|
|
201
|
-
cancelTimer(
|
|
201
|
+
cancelTimer(configurationTimer);
|
|
202
202
|
const started = identity();
|
|
203
|
-
|
|
203
|
+
configurationTimer = later(() => {
|
|
204
204
|
if (matches(started) && host.previous) {
|
|
205
205
|
fail("The page did not confirm its review settings. Reload before continuing.");
|
|
206
206
|
}
|
|
@@ -283,10 +283,17 @@ export function createFrameController({ sessionId, host, request, suspended, tra
|
|
|
283
283
|
if (!expectedConfiguration || expectedConfiguration.mode !== mode ||
|
|
284
284
|
expectedConfiguration.savePolicy !== savePolicy || loading())
|
|
285
285
|
return false;
|
|
286
|
+
// Confirmation is complete even when background tabs pause the visual handoff.
|
|
287
|
+
cancelTimer(configurationTimer);
|
|
288
|
+
configurationTimer = null;
|
|
286
289
|
state.configurationGeneration = state.generation;
|
|
290
|
+
const started = identity();
|
|
291
|
+
const appliedConfiguration = expectedConfiguration;
|
|
287
292
|
if (host.previous)
|
|
288
|
-
host.afterPaint(() => {
|
|
289
|
-
|
|
293
|
+
host.afterPaint(() => {
|
|
294
|
+
if (matches(started) && expectedConfiguration === appliedConfiguration && !loading())
|
|
295
|
+
finishReplacement();
|
|
296
|
+
});
|
|
290
297
|
if (configuration && configuration.mode === mode && configuration.savePolicy === savePolicy) {
|
|
291
298
|
configuration.settle(true);
|
|
292
299
|
}
|