Skip to content

Commit

Permalink
Remove redundant code.
Browse files Browse the repository at this point in the history
  • Loading branch information
bakar-io committed Apr 25, 2024
1 parent acf8f46 commit 5b47304
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions frontend/src/components/Config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,8 @@ function ToolSelectionField(props: {
);
}

function PublicLink(props: { assistantId: string }) {
const currentLink = window.location.href;
const link = currentLink.includes(props.assistantId)
? currentLink
: currentLink + "?shared_id=" + props.assistantId;
function PublicLink() {
const link = window.location.href;
return (
<div className="flex rounded-md shadow-sm mb-4">
<button
Expand Down Expand Up @@ -591,11 +588,7 @@ export function Config(props: {
<PublicToggle enabled={isPublic} setEnabled={setPublic} />
</div>
) : (
<>
{props.config?.public && (
<PublicLink assistantId={props.config?.assistant_id} />
)}
</>
<>{props.config?.public && <PublicLink />}</>
);
return (
<form
Expand Down

0 comments on commit 5b47304

Please sign in to comment.