mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
27 lines
643 B
TypeScript
27 lines
643 B
TypeScript
import { getIFrameSimulationData } from '~/lib/replay/Recording';
|
|
import { simulationAddData } from '~/lib/replay/ChatManager';
|
|
import { getCurrentIFrame } from '~/components/workbench/Preview';
|
|
|
|
async function flushSimulationData() {
|
|
//console.log("FlushSimulationData");
|
|
|
|
const iframe = getCurrentIFrame();
|
|
|
|
if (!iframe) {
|
|
return;
|
|
}
|
|
|
|
const simulationData = await getIFrameSimulationData(iframe);
|
|
|
|
if (!simulationData.length) {
|
|
return;
|
|
}
|
|
|
|
//console.log("HaveSimulationData", simulationData.length);
|
|
|
|
// Add the simulation data to the chat.
|
|
simulationAddData(simulationData);
|
|
}
|
|
|
|
export default flushSimulationData;
|