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:
Skye Elliot
2025-09-23 15:46:01 +01:00
committed by GitHub
parent ca3060af69
commit c8d937655b
6 changed files with 51 additions and 3 deletions

View File

@@ -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