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(() => {
const data = logger();
// TODO: remove this line
console.info('log');
if (this.justWokeup) {
this.justWokeup = false;
return;

View File

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