Lock out the first tab if Element is opened in a second tab. (#11425)
* Implement session lock dialogs * Bump analytics-events package * clean up resetJsDomAfterEach * fix types * update snapshot * update i18n strings
This commit is contained in:
parent
09c5e06d12
commit
839c0a720c
17 changed files with 663 additions and 50 deletions
|
@ -177,7 +177,7 @@ export async function getSessionLock(onNewInstance: () => Promise<void>): Promis
|
|||
|
||||
// and, once it has done so, stop pinging the lock.
|
||||
if (lockServicer !== null) {
|
||||
clearInterval(lockServicer);
|
||||
window.clearInterval(lockServicer);
|
||||
}
|
||||
window.localStorage.removeItem(SESSION_LOCK_CONSTANTS.STORAGE_ITEM_PING);
|
||||
window.localStorage.removeItem(SESSION_LOCK_CONSTANTS.STORAGE_ITEM_OWNER);
|
||||
|
@ -233,7 +233,7 @@ export async function getSessionLock(onNewInstance: () => Promise<void>): Promis
|
|||
|
||||
// claim the lock, and kick off a background process to service it every 5 seconds
|
||||
serviceLock();
|
||||
lockServicer = setInterval(serviceLock, 5000);
|
||||
lockServicer = window.setInterval(serviceLock, 5000);
|
||||
|
||||
// Now add a listener for other claimants to the lock.
|
||||
window.addEventListener("storage", onStorageEvent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue