mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
This commit is contained in:
parent
c4aee4d601
commit
2f9d2afcd3
1 changed files with 8 additions and 1 deletions
|
@ -744,13 +744,20 @@ export const newModelByInitData = (app: App, tab: Tab, json: any) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (json.instance === "Editor") {
|
} else if (json.instance === "Editor") {
|
||||||
|
if (json.rootId === json.blockId && json.action) {
|
||||||
|
if (typeof json.action === "string") {
|
||||||
|
json.action = json.action.replace(Constants.CB_GET_ALL, "");
|
||||||
|
} else if (typeof json.action === "object" && Array.isArray(json.action)) {
|
||||||
|
json.action = json.action.filter((item: string) => item !== Constants.CB_GET_ALL);
|
||||||
|
}
|
||||||
|
}
|
||||||
model = new Editor({
|
model = new Editor({
|
||||||
app,
|
app,
|
||||||
tab,
|
tab,
|
||||||
rootId: json.rootId,
|
rootId: json.rootId,
|
||||||
blockId: json.blockId,
|
blockId: json.blockId,
|
||||||
mode: json.mode,
|
mode: json.mode,
|
||||||
action: typeof json.action === "string" ? [json.action, Constants.CB_GET_FOCUS] : json.action.concat(Constants.CB_GET_FOCUS),
|
action: typeof json.action === "string" ? (json.action ? [json.action, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS]) : json.action.concat(Constants.CB_GET_FOCUS),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return model;
|
return model;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue