Require website selection before adding board component
This commit is contained in:
1 parent
09bc2ee5c8
commit
3d2f7f5a4b
1 file changed
+4
-2
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user