Skip to content

Commit

Permalink
fix: ensure canvas state is saved after loading JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Lisianthus-A committed Jan 7, 2025
1 parent 2723f8f commit 92f5f39
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/layout/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ function Header() {
try {
const text = await file.text();
const json = JSON.parse(text);
canvas.loadFromJson(json);
await canvas.loadFromJson(json);
setTimeout(() => {
canvas.saveToStack();
});
} catch (err) {
Toast.show("导入失败");
console.log("catch import error", err);
Expand Down

0 comments on commit 92f5f39

Please sign in to comment.