Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Require website selection before adding board component

Mike Cao3d2f7f5a4b33
diff --git a/src/app/(main)/boards/[boardId]/BoardComponentSelect.tsx b/src/app/(main)/boards/[boardId]/BoardComponentSelect.tsx
index 7222be6b1..c88714f04 100644
--- a/src/app/(main)/boards/[boardId]/BoardComponentSelect.tsx
+++ b/src/app/(main)/boards/[boardId]/BoardComponentSelect.tsx
@@ -98,7 +98,7 @@ export function BoardComponentSelect({
};
const handleAdd = () => {
- if (!selectedDef) return;
+ if (!selectedDef || !selectedWebsiteId) return;
const props: Record<string, any> = {};
@@ -137,6 +137,8 @@ export function BoardComponentSelect({
}
: null;
+ const canSave = !!selectedDef && !!selectedWebsiteId;
+
return (
<Column gap="4">
<Row gap="4" style={{ height: 600 }}>
@@ -271,7 +273,7 @@ export function BoardComponentSelect({
<Button variant="quiet" onPress={onClose}>
{t(labels.cancel)}
</Button>
- <Button variant="primary" onPress={handleAdd} isDisabled={!selectedDef}>
+ <Button variant="primary" onPress={handleAdd} isDisabled={!canSave}>
{t(labels.save)}
</Button>
</Row>