(feat): improve tray icon
(qol): update todo
This commit is contained in:
parent
92e5003989
commit
943203eeaf
10 changed files with 205 additions and 15 deletions
|
|
@ -1,5 +1,9 @@
|
|||
import { contextBridge, ipcRenderer } from "electron";
|
||||
import { ipcChannels, type DesktopScreenShareSource } from "../shared/ipc.js";
|
||||
import {
|
||||
ipcChannels,
|
||||
type DesktopCallStatus,
|
||||
type DesktopScreenShareSource,
|
||||
} from "../shared/ipc.js";
|
||||
|
||||
function windowAction(channel: string) {
|
||||
return () => ipcRenderer.invoke(channel);
|
||||
|
|
@ -27,6 +31,21 @@ const desktopApi = {
|
|||
updates: {
|
||||
checkForUpdates: () => ipcRenderer.invoke(ipcChannels.checkForUpdates),
|
||||
},
|
||||
call: {
|
||||
setStatus: (status: DesktopCallStatus) => {
|
||||
if (
|
||||
typeof status?.inCall !== "boolean" ||
|
||||
typeof status?.speaking !== "boolean" ||
|
||||
(status.iconDataUrl !== undefined &&
|
||||
(typeof status.iconDataUrl !== "string" ||
|
||||
!status.iconDataUrl.startsWith("data:image/png;base64,")))
|
||||
) {
|
||||
return Promise.reject(new Error("Invalid call status."));
|
||||
}
|
||||
|
||||
return ipcRenderer.invoke(ipcChannels.setCallStatus, status);
|
||||
},
|
||||
},
|
||||
window: {
|
||||
minimize: () => windowAction(ipcChannels.minimizeWindow),
|
||||
maximize: () => windowAction(ipcChannels.maximizeWindow),
|
||||
|
|
|
|||
Loading…
Reference in a new issue