diff --git a/src/js/port.js b/src/js/port.js index 3b011ed043..53c2df9b11 100644 --- a/src/js/port.js +++ b/src/js/port.js @@ -144,8 +144,10 @@ export function createPortExec(getTarget, {lock, once} = {}, target) { async function trackTarget(myQ) { tracking = true; - while (!(await navLocks.query()).held.some(v => v.name === lock)) - __.DEBUGPORT(PATH, 'waiting for lock', lock, await sleep(10)); + while (!(await navLocks.query()).held.some(v => v.name === lock)) { + __.DEBUGPORT(PATH, 'waiting for lock', lock); + await sleep(10); + } await navLocks.request(lock, NOP); tracking = false; __.DEBUGPORT(`${PATH} target disconnected`, target, lock, once);