Skip to content

Commit

Permalink
[ui] make reload button on RepositoryLocationErrorDialog optional
Browse files Browse the repository at this point in the history
  • Loading branch information
benpankow committed Dec 4, 2024
1 parent 396a8af commit 4e4ce93
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface Props {
error: PythonErrorFragment | {message: string} | null;
reloading: boolean;
onDismiss: () => void;
onTryReload: () => void;
onTryReload?: () => void;
}

export const RepositoryLocationErrorDialog = (props: Props) => {
Expand All @@ -27,9 +27,11 @@ export const RepositoryLocationErrorDialog = (props: Props) => {
<ErrorContents location={location} error={error} />
</DialogBody>
<DialogFooter>
<Button onClick={onTryReload} loading={reloading} intent="primary">
Reload again
</Button>
{onTryReload && (
<Button onClick={onTryReload} loading={reloading} intent="primary">
Reload again
</Button>
)}
<Button onClick={onDismiss}>Dismiss</Button>
</DialogFooter>
</Dialog>
Expand All @@ -50,9 +52,11 @@ export const RepositoryLocationNonBlockingErrorDialog = (props: Props) => {
<ErrorContents location={location} error={error} />
</DialogBody>
<DialogFooter>
<Button onClick={onTryReload} loading={reloading} intent="primary">
Reload
</Button>
{onTryReload && (
<Button onClick={onTryReload} loading={reloading} intent="primary">
Reload
</Button>
)}
<Button onClick={onDismiss}>Close</Button>
</DialogFooter>
</Dialog>
Expand Down

0 comments on commit 4e4ce93

Please sign in to comment.