Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ const OperatingSystemDropdown: FC<OperatingSystemDropdownProps> = () => {
// We parse the compatibility of the dropdown items
const parsedOperatingSystems = useMemo(
() => parseCompat(OPERATING_SYSTEMS, release),
// We only want to react on the change of the OS, Bitness, and Version
// We only want to react on the change of the Install Method
// eslint-disable-next-line react-hooks/exhaustive-deps
[release.os, release.platform, release.version]
[release.installMethod, release.os]
);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const PackageManagerDropdown: FC = () => {
),
// We only want to react on the change of the Version
// eslint-disable-next-line react-hooks/exhaustive-deps
[release.version]
[release.version, release.packageManager]
);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const PlatformDropdown: FC = () => {
: [],
// We only want to react on the change of the OS, Platform, and Version
// eslint-disable-next-line react-hooks/exhaustive-deps
[release.os, release.platform, release.version]
[release.os, release.version]
);

// We set the Platform to the next available Architecture when the current
Expand Down
9 changes: 5 additions & 4 deletions apps/site/util/downloadUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,14 @@ export const parseCompat = <
const satisfiesSemver = (semver: string) => satisfies(version, semver);

const supportsOS = (i: T['compatibility']) =>
os === 'LOADING' || (i.os?.includes(os) ?? true);
i.os?.includes(os as UserOS) ?? true;

const supportsInstallMethod = (i: T['compatibility']) =>
(installMethod === '' || i.installMethod?.includes(installMethod)) ?? true;
i.installMethod?.includes(installMethod as Types.InstallationMethod) ??
true;

const supportsPlatform = (i: T['compatibility']) =>
platform === '' || (i.platform?.includes(platform) ?? true);
i.platform?.includes(platform as UserPlatform) ?? true;

const supportsVersion = (i: T['compatibility']) =>
i.semver?.some(satisfiesSemver) ?? true;
Expand Down Expand Up @@ -145,7 +146,7 @@ export const OPERATING_SYSTEMS: Array<DownloadDropdownItem<UserOS>> = [
{
label: OperatingSystemLabel.AIX,
value: 'AIX',
compatibility: { installMethod: [] },
compatibility: { installMethod: ['' as Types.InstallationMethod] },
iconImage: <OSIcons.AIX width={16} height={16} />,
},
];
Expand Down