Vanessa 2025-09-20 17:02:11 +08:00
parent c4aee4d601
commit 2f9d2afcd3

View file

@ -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;