fix preview loading
Browse files- components/editor/preview/index.tsx +1 -1
- hooks/useAi.ts +1 -0
components/editor/preview/index.tsx
CHANGED
|
@@ -251,7 +251,7 @@ export const Preview = forwardRef<LivePreviewRef, { isNew: boolean }>(
|
|
| 251 |
)}
|
| 252 |
srcDoc={defaultHTML}
|
| 253 |
/>
|
| 254 |
-
) : isLoadingProject || globalAiLoading ? (
|
| 255 |
<div className="w-full h-full flex items-center justify-center relative">
|
| 256 |
<div className="py-10 w-full relative z-1 max-w-3xl mx-auto text-center">
|
| 257 |
<AiLoading
|
|
|
|
| 251 |
)}
|
| 252 |
srcDoc={defaultHTML}
|
| 253 |
/>
|
| 254 |
+
) : isNew && (isLoadingProject || globalAiLoading) ? (
|
| 255 |
<div className="w-full h-full flex items-center justify-center relative">
|
| 256 |
<div className="py-10 w-full relative z-1 max-w-3xl mx-auto text-center">
|
| 257 |
<AiLoading
|
hooks/useAi.ts
CHANGED
|
@@ -326,6 +326,7 @@ export const useAi = (onScrollToBottom?: () => void, livePreviewRef?: React.RefO
|
|
| 326 |
setSelectedElement(null);
|
| 327 |
setSelectedFiles([]);
|
| 328 |
setIsEditableModeEnabled(false);
|
|
|
|
| 329 |
}
|
| 330 |
|
| 331 |
if (audio.current) audio.current.play();
|
|
|
|
| 326 |
setSelectedElement(null);
|
| 327 |
setSelectedFiles([]);
|
| 328 |
setIsEditableModeEnabled(false);
|
| 329 |
+
setIsAiWorking(false); // This was missing!
|
| 330 |
}
|
| 331 |
|
| 332 |
if (audio.current) audio.current.play();
|