mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 https://github.com/siyuan-note/siyuan/issues/9368 systemPreferences
This commit is contained in:
parent
b869fd1d9d
commit
2ca7253d1f
2 changed files with 12 additions and 6 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue