fix: flash problem

This commit is contained in:
dayuan.jiang
2025-03-25 08:56:24 +00:00
parent 8882aa9ee1
commit 5d152c66d5
5 changed files with 148 additions and 57 deletions

View File

@@ -2,7 +2,6 @@
import { DrawIoEmbed, DrawIoEmbedRef } from "react-drawio";
import { useRef, useState } from "react";
import { Button } from "@/components/ui/button";
import { extractDiagramXML } from "./extract_xml";
import ChatPanel from "@/components/chat-panel";
@@ -28,6 +27,7 @@ export default function Home() {
const loadDiagram = (chart: string) => {
if (drawioRef.current) {
console.log("xml before load", chart);
drawioRef.current.load({
xml: chart,
});
@@ -65,6 +65,7 @@ export default function Home() {
</div>
<div className="w-1/3 p-1 border-gray-300">
<ChatPanel
chartXML={chartXML}
onDisplayChart={(xml) => loadDiagram(xml)}
onFetchChart={() => {
return new Promise<string>((resolve) => {