Vanessa 2022-08-21 14:15:13 +08:00
parent 8ee5c07231
commit ebe93856e0
6 changed files with 274 additions and 130 deletions

View file

@ -38,6 +38,7 @@ import {Dialog} from "../dialog";
import {unicode2Emoji} from "../emoji";
import {deleteFile} from "../editor/deleteFile";
import {escapeHtml} from "./escape";
import {syncGuide} from "../sync/syncGuide";
const getRightBlock = (element: HTMLElement, x: number, y: number) => {
let index = 1;
@ -378,14 +379,7 @@ export const globalShortcut = () => {
if (matchHotKey(window.siyuan.config.keymap.general.syncNow.custom, event)) {
event.preventDefault();
event.stopPropagation();
if (needSubscribe() || document.querySelector("#barSync svg").classList.contains("fn__rotate")) {
return;
}
if (!window.siyuan.config.sync.enabled) {
showMessage(window.siyuan.languages._kernel[124]);
return;
}
fetchPost("/api/sync/performSync", {});
syncGuide(document.querySelector("#barSync svg"));
return;
}
if (matchHotKey(window.siyuan.config.keymap.general.lockScreen.custom, event)) {

View file

@ -23,6 +23,7 @@ import {openSetting} from "../config";
import {getSearch} from "./functions";
import {openHistory} from "./history";
import {initStatus} from "../layout/status";
import {syncGuide} from "../sync/syncGuide";
const matchKeymap = (keymap: Record<string, IKeymapItem>, key1: "general" | "editor", key2?: "general" | "insert" | "heading" | "list" | "table") => {
if (key1 === "general") {
@ -205,14 +206,7 @@ const initBar = () => {
event.stopPropagation();
break;
} else if (target.id === "barSync") {
if (needSubscribe() || target.firstElementChild.classList.contains("fn__rotate")) {
return;
}
if (!window.siyuan.config.sync.enabled) {
showMessage(window.siyuan.languages._kernel[124]);
return;
}
fetchPost("/api/sync/performSync", {});
syncGuide(target.firstElementChild);
event.stopPropagation();
break;
} else if (target.id === "barForward") {