mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 14:22:28 +08:00
fix: flash problem
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user