Skip to content

Commit

Permalink
Fix potential infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
SawyerHood committed Jun 4, 2024
1 parent 50e7fe0 commit a6ecc27
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
1 change: 1 addition & 0 deletions components/BrowserShape.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ export class BrowserShapeUtil extends BaseBoxShapeUtil<BrowserShape> {
name={`iframe-1-${shape.id}`}
id={`iframe-1-${shape.id}`}
onLoad={(e) => {
if (!isLoading) return;
const iframe = e.target as HTMLIFrameElement;
const html = iframe.contentDocument?.documentElement.outerHTML;
if (html === `<html><head></head><body></body></html>`) {
Expand Down
20 changes: 0 additions & 20 deletions components/Canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,6 @@ function UI() {
}
}, [editor]);

// useEffect(() => {
// const unlisten = editor.store.listen(
// (update) => {
// for (const record of Object.values(update.changes.added)) {
// if (record.typeName === "shape" && record.type === "text") {
// editor.updateShape({
// id: record.id,
// type: record.type,
// meta: {
// prompt: true,
// },
// });
// }
// }
// },
// { scope: "document", source: "user" }
// );
// return unlisten;
// }, [editor]);

return (
<>
<div
Expand Down

0 comments on commit a6ecc27

Please sign in to comment.