mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
This commit is contained in:
parent
d3b603ff6b
commit
bf2e2123b7
4 changed files with 9 additions and 9 deletions
|
|
@ -84,13 +84,13 @@ class App {
|
|||
menus: new Menus()
|
||||
};
|
||||
fetchPost("/api/system/getConf", {}, response => {
|
||||
window.siyuan.config = response.data;
|
||||
window.siyuan.config = response.data.conf;
|
||||
fetchGet(`/appearance/langs/${window.siyuan.config.appearance.lang}.json?v=${Constants.SIYUAN_VERSION}`, (lauguages) => {
|
||||
window.siyuan.languages = lauguages;
|
||||
bootSync();
|
||||
fetchPost("/api/setting/getCloudUser", {}, userResponse => {
|
||||
window.siyuan.user = userResponse.data;
|
||||
onGetConfig();
|
||||
onGetConfig(response.data.start);
|
||||
account.onSetaccount();
|
||||
resizeDrag();
|
||||
setTitle(window.siyuan.languages.siyuanNote);
|
||||
|
|
|
|||
|
|
@ -269,12 +269,12 @@ const JSONToCenter = (json: any, layout?: Layout | Wnd | Tab | Model) => {
|
|||
}
|
||||
};
|
||||
|
||||
export const JSONToLayout = () => {
|
||||
export const JSONToLayout = (isStart: boolean) => {
|
||||
JSONToCenter(window.siyuan.config.uiLayout.layout);
|
||||
JSONToDock(window.siyuan.config.uiLayout);
|
||||
const allModels = getAllModels();
|
||||
// 启动时不打开页签,需要移除没有钉住的页签
|
||||
if (window.siyuan.config.fileTree.closeTabsOnStart) {
|
||||
if (window.siyuan.config.fileTree.closeTabsOnStart && isStart) {
|
||||
allModels.editor.forEach(item => {
|
||||
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
||||
item.parent.parent.removeTab(item.parent.id);
|
||||
|
|
|
|||
|
|
@ -43,13 +43,13 @@ class App {
|
|||
}
|
||||
});
|
||||
fetchPost("/api/system/getConf", {}, confResponse => {
|
||||
confResponse.data.keymap = Constants.SIYUAN_KEYMAP;
|
||||
window.siyuan.config = confResponse.data;
|
||||
confResponse.data.conf.keymap = Constants.SIYUAN_KEYMAP;
|
||||
window.siyuan.config = confResponse.data.conf;
|
||||
fetchGet(`/appearance/langs/${window.siyuan.config.appearance.lang}.json?v=${Constants.SIYUAN_VERSION}`, (lauguages) => {
|
||||
window.siyuan.languages = lauguages;
|
||||
document.title = window.siyuan.languages.siyuanNote;
|
||||
bootSync();
|
||||
loadAssets(confResponse.data.appearance);
|
||||
loadAssets(confResponse.data.conf.appearance);
|
||||
initAssets();
|
||||
fetchPost("/api/system/getEmojiConf", {}, emojiResponse => {
|
||||
window.siyuan.emojis = emojiResponse.data as IEmoji[];
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ export const setProxy = () => {
|
|||
/// #endif
|
||||
};
|
||||
|
||||
export const onGetConfig = () => {
|
||||
export const onGetConfig = (isStart:boolean) => {
|
||||
const matchKeymap1 = matchKeymap(Constants.SIYUAN_KEYMAP.general, "general");
|
||||
const matchKeymap2 = matchKeymap(Constants.SIYUAN_KEYMAP.editor.general, "editor", "general");
|
||||
const matchKeymap3 = matchKeymap(Constants.SIYUAN_KEYMAP.editor.insert, "editor", "insert");
|
||||
|
|
@ -128,7 +128,7 @@ export const onGetConfig = () => {
|
|||
fetchPost("/api/system/getEmojiConf", {}, response => {
|
||||
window.siyuan.emojis = response.data as IEmoji[];
|
||||
try {
|
||||
JSONToLayout();
|
||||
JSONToLayout(isStart);
|
||||
} catch (e) {
|
||||
fetchPost("/api/system/setUILayout", {layout: {}}, () => {
|
||||
window.location.reload();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue