This commit is contained in:
Vanessa 2023-10-08 16:33:04 +08:00
parent b869fd1d9d
commit 2ca7253d1f
2 changed files with 12 additions and 6 deletions

View file

@ -15,7 +15,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
const {
net, app, BrowserWindow, shell, Menu, screen, ipcMain, globalShortcut, Tray, dialog
net, app, BrowserWindow, shell, Menu, screen, ipcMain, globalShortcut, Tray, dialog, systemPreferences
} = require("electron");
const path = require("path");
const fs = require("fs");
@ -674,6 +674,12 @@ app.whenReady().then(() => {
if (data.cmd === "isFullScreen") {
return getWindowByContentId(event.sender.id).isFullScreen();
}
if (data.cmd === "getMicrophone") {
return systemPreferences.getMediaAccessStatus("microphone");
}
if (data.cmd === "askMicrophone") {
return systemPreferences.askForMediaAccess("microphone");
}
});
ipcMain.on("siyuan-cmd", (event, cmd) => {
switch (cmd) {