Skip to content

Commit

Permalink
fix(ui): have VersionWithRefresh depend on original data (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephKav authored Jan 15, 2025
1 parent 757c716 commit 7d16750
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const VersionWithRefresh: FC<Props> = ({
return convertUIDeployedVersionDataEditToAPI(
original as DeployedVersionLookupEditType,
);
}, [serviceID, dataTarget]);
}, [original, serviceID, dataTarget]);
const url: string | undefined = useWatch({ name: `${dataTarget}.url` });
const dataTargetErrors = useErrors(dataTarget, true);
const { data, refetchData } = useValuesRefetch(dataTarget);
Expand Down
5 changes: 2 additions & 3 deletions web/ui/react-app/src/utils/is-empty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
* @param arg - The array to check.
* @returns true when array is empty, null, or undefined. false otherwise.
*/
export const isEmptyArray = <T extends unknown[] | undefined>(
arg: T,
): boolean => ((arg as unknown[]) ?? []).length === 0;
export const isEmptyArray = (arg?: unknown[]): arg is [] | undefined =>
((arg as unknown[]) ?? []).length === 0;

export const isEmptyObject = <T extends Record<string, unknown> | undefined>(
arg: T,
Expand Down

0 comments on commit 7d16750

Please sign in to comment.