Update Blueprints.tsx
This commit is contained in:
@@ -26,15 +26,6 @@ export default function SiteBuilderBlueprints() {
|
|||||||
isBulk: boolean;
|
isBulk: boolean;
|
||||||
}>({ isOpen: false, blueprint: null, isBulk: false });
|
}>({ isOpen: false, blueprint: null, isBulk: false });
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (activeSite?.id) {
|
|
||||||
loadBlueprints(activeSite.id);
|
|
||||||
} else {
|
|
||||||
setBlueprints([]);
|
|
||||||
}
|
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, [activeSite?.id]);
|
|
||||||
|
|
||||||
const loadBlueprints = async (siteId: number) => {
|
const loadBlueprints = async (siteId: number) => {
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
@@ -47,6 +38,15 @@ export default function SiteBuilderBlueprints() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (activeSite?.id) {
|
||||||
|
loadBlueprints(activeSite.id);
|
||||||
|
} else {
|
||||||
|
setBlueprints([]);
|
||||||
|
}
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [activeSite?.id]);
|
||||||
|
|
||||||
const handleOpenPreview = async (blueprintId: number) => {
|
const handleOpenPreview = async (blueprintId: number) => {
|
||||||
try {
|
try {
|
||||||
await loadBlueprint(blueprintId);
|
await loadBlueprint(blueprintId);
|
||||||
|
|||||||
Reference in New Issue
Block a user