mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-13 10:44:20 +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
|
|
@ -8,7 +8,7 @@ import {setEditMode} from "../util/setEditMode";
|
|||
import {RecordMedia} from "../util/RecordMedia";
|
||||
import {hideMessage, showMessage} from "../../dialog/message";
|
||||
import {uploadFiles} from "../upload";
|
||||
import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName} from "../util/hasClosest";
|
||||
import {hasClosestBlock, hasClosestByAttribute} from "../util/hasClosest";
|
||||
import {needSubscribe} from "../../util/needSubscribe";
|
||||
import {isMobile} from "../../util/functions";
|
||||
import {zoomOut} from "../../menus/protyle";
|
||||
|
|
@ -18,7 +18,7 @@ import {openFileById} from "../../editor/util";
|
|||
import {setPanelFocus} from "../../layout/util";
|
||||
/// #endif
|
||||
/// #if !BROWSER
|
||||
import {systemPreferences} from "@electron/remote";
|
||||
import {ipcRenderer} from "electron";
|
||||
/// #endif
|
||||
import {onGet} from "../util/onGet";
|
||||
import {hideElements} from "../ui/hideElements";
|
||||
|
|
@ -227,7 +227,7 @@ export class Breadcrumb {
|
|||
}
|
||||
}
|
||||
|
||||
public showMenu(protyle: IProtyle, position:IPosition) {
|
||||
public showMenu(protyle: IProtyle, position: IPosition) {
|
||||
if (!window.siyuan.menus.menu.element.classList.contains("fn__none") &&
|
||||
window.siyuan.menus.menu.element.getAttribute("data-name") === "breadcrumbMore") {
|
||||
window.siyuan.menus.menu.remove();
|
||||
|
|
@ -271,12 +271,12 @@ export class Breadcrumb {
|
|||
click: async () => {
|
||||
/// #if !BROWSER
|
||||
if (window.siyuan.config.system.os === "darwin") {
|
||||
const status = systemPreferences.getMediaAccessStatus("microphone");
|
||||
const status = await ipcRenderer.invoke(Constants.SIYUAN_GET, {cmd: "getMicrophone"})
|
||||
if (["denied", "restricted", "unknown"].includes(status)) {
|
||||
showMessage(window.siyuan.languages.microphoneDenied);
|
||||
return;
|
||||
} else if (status === "not-determined") {
|
||||
const isAccess = await systemPreferences.askForMediaAccess("microphone");
|
||||
const isAccess = await ipcRenderer.invoke(Constants.SIYUAN_GET, {cmd: "askMicrophone"})
|
||||
if (!isAccess) {
|
||||
showMessage(window.siyuan.languages.microphoneNotAccess);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue