Skip to content

Commit a6ecc27

Browse files
committed
Fix potential infinite loop
1 parent 50e7fe0 commit a6ecc27

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

components/BrowserShape.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ export class BrowserShapeUtil extends BaseBoxShapeUtil<BrowserShape> {
377377
name={`iframe-1-${shape.id}`}
378378
id={`iframe-1-${shape.id}`}
379379
onLoad={(e) => {
380+
if (!isLoading) return;
380381
const iframe = e.target as HTMLIFrameElement;
381382
const html = iframe.contentDocument?.documentElement.outerHTML;
382383
if (html === `<html><head></head><body></body></html>`) {

components/Canvas.tsx

-20
Original file line numberDiff line numberDiff line change
@@ -49,26 +49,6 @@ function UI() {
4949
}
5050
}, [editor]);
5151

52-
// useEffect(() => {
53-
// const unlisten = editor.store.listen(
54-
// (update) => {
55-
// for (const record of Object.values(update.changes.added)) {
56-
// if (record.typeName === "shape" && record.type === "text") {
57-
// editor.updateShape({
58-
// id: record.id,
59-
// type: record.type,
60-
// meta: {
61-
// prompt: true,
62-
// },
63-
// });
64-
// }
65-
// }
66-
// },
67-
// { scope: "document", source: "user" }
68-
// );
69-
// return unlisten;
70-
// }, [editor]);
71-
7252
return (
7353
<>
7454
<div

0 commit comments

Comments
 (0)