feat: Disable session lock when running in element-desktop (#30643)
* feat: Disable session lock when running in element-desktop * feat: Use Platform abstractions over direct invocation for session lock. * fix: Remove window.electron checks from session lock methods. * docs: Remove extraneous doc comments. * feat: Convert BasePlatform session methods to abstract methods. * fix: Check for PlatformPeg instance in session lock. * fix: Remove async marker from checkSessionLockFree
This commit is contained in:
@@ -10,6 +10,7 @@ import { type MethodLikeKeys, mocked, type MockedObject } from "jest-mock";
|
||||
|
||||
import BasePlatform from "../../src/BasePlatform";
|
||||
import PlatformPeg from "../../src/PlatformPeg";
|
||||
import * as SessionLock from "../../src/utils/SessionLock";
|
||||
|
||||
// doesn't implement abstract
|
||||
// @ts-ignore
|
||||
@@ -18,6 +19,14 @@ class MockPlatform extends BasePlatform {
|
||||
super();
|
||||
Object.assign(this, platformMocks);
|
||||
}
|
||||
|
||||
public checkSessionLockFree(): boolean {
|
||||
return SessionLock.checkSessionLockFree();
|
||||
}
|
||||
|
||||
public async getSessionLock(onNewInstance: () => Promise<void>): Promise<boolean> {
|
||||
return SessionLock.getSessionLock(onNewInstance);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Mock Platform Peg
|
||||
|
||||
Reference in New Issue
Block a user