fix(onboarding): preserve selected integrations when navigating back
The multi-select grid initializes its own internal Set on mount, so returning from the configure phase to the select phase lost all selections. Accept an initialSelection prop and pass the parent's selectedKinds to restore state on re-mount.
This commit is contained in:
2 files changed
+4
-2
No files matched your search
@@ -17,15 +17,17 @@ import {
|
||||
|
||||
interface IntegrationMultiSelectGridProps {
|
||||
onSelectionChange: (kinds: IntegrationKind[]) => void;
|
||||
initialSelection?: IntegrationKind[];
|
||||
enableMockIntegration?: boolean;
|
||||
}
|
||||
|
||||
export const IntegrationMultiSelectGrid = ({
|
||||
onSelectionChange,
|
||||
initialSelection = [],
|
||||
enableMockIntegration = false,
|
||||
}: IntegrationMultiSelectGridProps) => {
|
||||
const [search, setSearch] = useState("");
|
||||
const [selectedKinds, setSelectedKinds] = useState<Set<IntegrationKind>>(new Set());
|
||||
const [selectedKinds, setSelectedKinds] = useState<Set<IntegrationKind>>(() => new Set(initialSelection));
|
||||
const t = useI18n();
|
||||
|
||||
const toggleKind = useCallback(
|
||||
|
||||
Reference in new issue
Block a user