Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 6, 2024
1 parent ef51290 commit 008ffd0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
11 changes: 8 additions & 3 deletions src/ImageBuilder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ function ImageLogs({ setTerm, setFitAddon }) {
}

export function ImageBuilder({ name }) {
const { repo, repoId, repoFieldProps, repoError, repoIsValidating} = useRepositoryField();
const { repo, repoId, repoFieldProps, repoError, repoIsValidating } =
useRepositoryField();
const { ref, refError, refFieldProps, refIsLoading } = useRefField(repoId);
const repoFieldRef = useRef();
const branchFieldRef = useRef();
Expand Down Expand Up @@ -150,7 +151,9 @@ export function ImageBuilder({ name }) {
aria-invalid={!!repoError}
/>
{repoIsValidating && (
<div className="profile-option-control-info">Validating repository...</div>
<div className="profile-option-control-info">
Validating repository...
</div>
)}
{repoError && (
<div className="profile-option-control-error">{repoError}</div>
Expand All @@ -173,7 +176,9 @@ export function ImageBuilder({ name }) {
isDisabled={!refFieldProps.options}
/>
{refIsLoading && !refIsLoading && (
<div className="profile-option-control-info">Loading Git ref options...</div>
<div className="profile-option-control-info">
Loading Git ref options...
</div>
)}
{refError && (
<div className="profile-option-control-error">{refError}</div>
Expand Down
5 changes: 3 additions & 2 deletions src/hooks/useRefField.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ export default function useRefField(repository) {
Promise.all([
fetchRef(repository, "branches"),
fetchRef(repository, "tags"),
]).then((results) => {
])
.then((results) => {
const refOptions = results.flat().map(({ name }) => ({
label: name,
value: name,
}));
setOptions(refOptions);
})
.finally(() => setIsLoading(false))
.finally(() => setIsLoading(false));
}
}, [repository]);

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useRepositoryField.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function useRepositoryField() {
const [isValidating, setIsValidating] = useState(false);

const validate = async () => {
setIsValidating(true)
setIsValidating(true);
setError();
const orgRepoString = extractOrgAndRepo(value);

Expand Down

0 comments on commit 008ffd0

Please sign in to comment.