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

@@ -558,4 +558,12 @@ export default class ElectronPlatform extends BasePlatform {
}
return url;
}
public checkSessionLockFree(): boolean {
return true;
}
public async getSessionLock(_onNewInstance: () => Promise<void>): Promise<boolean> {
return true;
}
}

View File

@@ -22,6 +22,7 @@ import ToastStore from "../../stores/ToastStore.ts";
import GenericToast from "../../components/views/toasts/GenericToast.tsx";
import SdkConfig from "../../SdkConfig.ts";
import type { ActionPayload } from "../../dispatcher/payloads.ts";
import * as SessionLock from "../../utils/SessionLock.ts";
const POKE_RATE_MS = 10 * 60 * 1000; // 10 min
@@ -268,4 +269,12 @@ export default class WebPlatform extends BasePlatform {
public reload(): void {
window.location.reload();
}
public checkSessionLockFree(): boolean {
return SessionLock.checkSessionLockFree();
}
public async getSessionLock(onNewInstance: () => Promise<void>): Promise<boolean> {
return SessionLock.getSessionLock(onNewInstance);
}
}