fix: 页面加载之后就被标记位 isModified

This commit is contained in:
mario.gk 2020-08-14 18:13:09 +08:00
parent e2d712f52f
commit 2840d2747f
2 changed files with 5 additions and 2 deletions

View File

@ -36,8 +36,6 @@ export class History {
this.obx = autorun(() => { this.obx = autorun(() => {
const data = logger(); const data = logger();
// TODO: remove this line
console.info('log');
if (this.justWokeup) { if (this.justWokeup) {
this.justWokeup = false; this.justWokeup = false;
return; return;

View File

@ -53,6 +53,11 @@ const pages = Object.assign(project, {
componentsMap: [], componentsMap: [],
componentsTree, componentsTree,
}, true); }, true);
// FIXME: 根本原因应该是 propStash 导致的,这样可以避免页面加载之后就被标记为 isModified
setTimeout(() => {
project.currentDocument?.history.savePoint();
}, 0);
}, },
addPage(data: OldPageData | RootSchema) { addPage(data: OldPageData | RootSchema) {
if (isPageDataV1(data)) { if (isPageDataV1(data)) {