This commit is contained in:
Vanessa 2023-05-08 10:59:13 +08:00
parent aa56c16830
commit 4312e46d27
3 changed files with 4 additions and 6 deletions

View file

@ -26,7 +26,6 @@ import {initBar} from "../layout/topBar";
import {setProxy} from "../config/util/setProxy"; import {setProxy} from "../config/util/setProxy";
import {openChangelog} from "./openChangelog"; import {openChangelog} from "./openChangelog";
import {getIdFromSYProtocol, isSYProtocol} from "../util/pathName"; import {getIdFromSYProtocol, isSYProtocol} from "../util/pathName";
import {App} from "../index";
const matchKeymap = (keymap: Record<string, IKeymapItem>, key1: "general" | "editor", key2?: "general" | "insert" | "heading" | "list" | "table") => { const matchKeymap = (keymap: Record<string, IKeymapItem>, key1: "general" | "editor", key2?: "general" | "insert" | "heading" | "list" | "table") => {
if (key1 === "general") { if (key1 === "general") {
@ -85,7 +84,7 @@ const hasKeymap = (keymap: Record<string, IKeymapItem>, key1: "general" | "edito
return match; return match;
}; };
export const onGetConfig = (isStart: boolean, app:App) => { export const onGetConfig = (isStart: boolean) => {
const matchKeymap1 = matchKeymap(Constants.SIYUAN_KEYMAP.general, "general"); const matchKeymap1 = matchKeymap(Constants.SIYUAN_KEYMAP.general, "general");
const matchKeymap2 = matchKeymap(Constants.SIYUAN_KEYMAP.editor.general, "editor", "general"); const matchKeymap2 = matchKeymap(Constants.SIYUAN_KEYMAP.editor.general, "editor", "general");
const matchKeymap3 = matchKeymap(Constants.SIYUAN_KEYMAP.editor.insert, "editor", "insert"); const matchKeymap3 = matchKeymap(Constants.SIYUAN_KEYMAP.editor.insert, "editor", "insert");
@ -141,7 +140,7 @@ export const onGetConfig = (isStart: boolean, app:App) => {
resetLayout(); resetLayout();
} }
}); });
initBar(app); initBar();
setProxy(); setProxy();
initStatus(); initStatus();
initWindow(); initWindow();

View file

@ -171,7 +171,7 @@ export class App {
fetchPost("/api/setting/getCloudUser", {}, userResponse => { fetchPost("/api/setting/getCloudUser", {}, userResponse => {
window.siyuan.user = userResponse.data; window.siyuan.user = userResponse.data;
loadPlugins(siyuanApp); loadPlugins(siyuanApp);
onGetConfig(response.data.start, siyuanApp); onGetConfig(response.data.start);
account.onSetaccount(); account.onSetaccount();
resizeDrag(); resizeDrag();
setTitle(window.siyuan.languages.siyuanNote); setTitle(window.siyuan.languages.siyuanNote);

View file

@ -9,7 +9,6 @@ import {MenuItem} from "../menus/Menu";
import {setMode} from "../util/assets"; import {setMode} from "../util/assets";
import {openSetting} from "../config"; import {openSetting} from "../config";
import {openSearch} from "../search/spread"; import {openSearch} from "../search/spread";
import {App} from "../index";
export const updateEditModeElement = () => { export const updateEditModeElement = () => {
const target = document.querySelector("#barReadonly"); const target = document.querySelector("#barReadonly");
@ -24,7 +23,7 @@ export const updateEditModeElement = () => {
} }
}; };
export const initBar = (app: App) => { export const initBar = () => {
const toolbarElement = document.getElementById("toolbar"); const toolbarElement = document.getElementById("toolbar");
toolbarElement.innerHTML = ` toolbarElement.innerHTML = `
<div id="barWorkspace" class="toolbar__item"> <div id="barWorkspace" class="toolbar__item">