mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Progressively rebuild when files change
This commit is contained in:
8 files changed
+225
-6
No files matched your search
@@ -19,6 +19,7 @@ import { StarButton } from '@/components/StarButton';
|
||||
import { useBuildProject } from '@/hooks/useBuildProject';
|
||||
import { useIsProjectPreviewable } from '@/hooks/useIsProjectPreviewable';
|
||||
import { useConsoleError } from '@/hooks/useConsoleError';
|
||||
import { useAutoBuild } from '@/hooks/useAutoBuild';
|
||||
|
||||
export function ProjectView() {
|
||||
const { projectId } = useParams<{ projectId: string }>();
|
||||
@@ -43,6 +44,13 @@ export function ProjectView() {
|
||||
const build = useBuildProject(projectId!);
|
||||
const { data: isPreviewable = false } = useIsProjectPreviewable(projectId!);
|
||||
|
||||
// Enable auto-build for previewable projects
|
||||
useAutoBuild({
|
||||
projectId: projectId!,
|
||||
enabled: isPreviewable,
|
||||
debounceMs: 2000,
|
||||
});
|
||||
|
||||
const loadProject = useCallback(async () => {
|
||||
if (!projectId) return;
|
||||
|
||||
|
||||
Reference in new issue
Block a user