mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
fix regression with preview not auto-updating
This commit is contained in:
1 parent
240f837767
commit
b8b7c13e03
1 file changed
+7
-1
@@ -18,8 +18,14 @@ export function ProjectView() {
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [activeTab, setActiveTab] = useState<'preview' | 'code'>('preview');
|
||||
|
||||
const handleBuildComplete = useCallback(() => {
|
||||
const handleBuildComplete = useCallback((projectId: string) => {
|
||||
setActiveTab('preview');
|
||||
// Dispatch custom event to notify PreviewPane that build is complete
|
||||
const event = new CustomEvent('buildComplete', {
|
||||
detail: { projectId }
|
||||
});
|
||||
window.dispatchEvent(event);
|
||||
console.log('Dispatched buildComplete event for project:', projectId);
|
||||
}, []);
|
||||
const [mobileView, setMobileView] = useState<'chat' | 'preview' | 'code'>('chat');
|
||||
const projectsManager = useProjectsManager();
|
||||
|
||||
Reference in new issue
Block a user