Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/vector/platform/ElectronPlatform.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export default class ElectronPlatform extends BasePlatform {
private badgeOverlayRenderer?: BadgeOverlayRenderer;
private config!: IConfigOptions;
private supportedSettings?: Record<string, boolean>;
private clientStartedPromiseWithResolvers = Promise.withResolvers<void>();

public constructor() {
super();
Expand Down Expand Up @@ -184,7 +185,9 @@ export default class ElectronPlatform extends BasePlatform {
await this.ipc.call("callDisplayMediaCallback", source ?? { id: "", name: "", thumbnailURL: "" });
});

this.electron.on("showToast", (ev, { title, description, priority = 40 }) => {
this.electron.on("showToast", async (ev, { title, description, priority = 40 }) => {
await this.clientStartedPromiseWithResolvers.promise;

const key = uniqueId("electron_showToast_");
const onPrimaryClick = (): void => {
ToastStore.sharedInstance().dismissToast(key);
Expand Down Expand Up @@ -214,6 +217,10 @@ export default class ElectronPlatform extends BasePlatform {
if (["call_state"].includes(payload.action)) {
this.electron.send("app_onAction", payload);
}

if (payload.action === "client_started") {
this.clientStartedPromiseWithResolvers.resolve();
}
}

private async initialise(): Promise<void> {
Expand Down
Loading