diff --git a/src/common/MenuLayout.tsx b/src/common/MenuLayout.tsx
index 57bd1189..3743424a 100644
--- a/src/common/MenuLayout.tsx
+++ b/src/common/MenuLayout.tsx
@@ -5,7 +5,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import classNames from 'classnames';
import { withSelectedServer } from '../servers/helpers/withSelectedServer';
import { useSwipeable, useToggle } from '../utils/helpers/hooks';
-import { versionMatch } from '../utils/helpers/version';
+import { supportsOrphanVisits, supportsTagVisits } from '../utils/helpers/features';
import { isReachableServer } from '../servers/data';
import NotFound from './NotFound';
import { AsideMenuProps } from './AsideMenu';
@@ -30,8 +30,8 @@ const MenuLayout = (
return ;
}
- const addTagsVisitsRoute = versionMatch(selectedServer.version, { minVersion: '2.2.0' });
- const addOrphanVisitsRoute = versionMatch(selectedServer.version, { minVersion: '2.6.0' });
+ const addTagsVisitsRoute = supportsTagVisits(selectedServer);
+ const addOrphanVisitsRoute = supportsOrphanVisits(selectedServer);
const burgerClasses = classNames('menu-layout__burger-icon', { 'menu-layout__burger-icon--active': sidebarVisible });
const swipeableProps = useSwipeable(showSidebar, hideSidebar);
diff --git a/src/short-urls/CreateShortUrl.tsx b/src/short-urls/CreateShortUrl.tsx
index 7bf2fe1f..bf48e394 100644
--- a/src/short-urls/CreateShortUrl.tsx
+++ b/src/short-urls/CreateShortUrl.tsx
@@ -5,9 +5,10 @@ import { InputType } from 'reactstrap/lib/Input';
import * as m from 'moment';
import DateInput, { DateInputProps } from '../utils/DateInput';
import Checkbox from '../utils/Checkbox';
-import { versionMatch, Versions } from '../utils/helpers/version';
+import { Versions } from '../utils/helpers/version';
+import { supportsListingDomains, supportsSettingShortCodeLength } from '../utils/helpers/features';
import { handleEventPreventingDefault, hasValue } from '../utils/utils';
-import { isReachableServer, SelectedServer } from '../servers/data';
+import { SelectedServer } from '../servers/data';
import { formatIsoDate } from '../utils/helpers/date';
import { TagsSelectorProps } from '../tags/helpers/TagsSelector';
import { DomainSelectorProps } from '../domains/DomainSelector';
@@ -117,9 +118,8 @@ const CreateShortUrl = (
>
);
- const currentServerVersion = isReachableServer(selectedServer) ? selectedServer.version : '';
- const showDomainSelector = versionMatch(currentServerVersion, { minVersion: '2.4.0' });
- const disableShortCodeLength = !versionMatch(currentServerVersion, { minVersion: '2.1.0' });
+ const showDomainSelector = supportsListingDomains(selectedServer);
+ const disableShortCodeLength = !supportsSettingShortCodeLength(selectedServer);
return (