Skip to content

Commit

Permalink
[Bug]: Prevent selection of "add more repo" option in dropdown (#5688)
Browse files Browse the repository at this point in the history
  • Loading branch information
malhotra5 authored Dec 19, 2024
1 parent 3db118f commit 3876f4a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from "react";
import { Autocomplete, AutocompleteItem } from "@nextui-org/react";
import { useDispatch } from "react-redux";
import posthog from "posthog-js";
Expand All @@ -14,6 +15,7 @@ export function GitHubRepositorySelector({
repositories,
}: GitHubRepositorySelectorProps) {
const { data: config } = useConfig();
const [selectedKey, setSelectedKey] = React.useState<string | null>(null);

// Add option to install app onto more repos
const finalRepositories =
Expand All @@ -36,6 +38,7 @@ export function GitHubRepositorySelector({
dispatch(setSelectedRepository(repo.full_name));
posthog.capture("repository_selected");
onSelect();
setSelectedKey(id);
}
};

Expand Down Expand Up @@ -63,6 +66,7 @@ export function GitHubRepositorySelector({
name="repo"
aria-label="GitHub Repository"
placeholder="Select a GitHub project"
selectedKey={selectedKey}
inputProps={{
classNames: {
inputWrapper:
Expand Down

0 comments on commit 3876f4a

Please sign in to comment.