Skip to content

Commit bb75bdc

Browse files
committed
Fixed error when trying to load Async API spec fo v2.10.0 due to wrong version comparison.
1 parent 9ccc4d3 commit bb75bdc

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org).
66

7+
## [1.9.1] - 2021-12-12
8+
### Added
9+
* *Nothing*
10+
11+
### Changed
12+
* *Nothing*
13+
14+
### Deprecated
15+
* *Nothing*
16+
17+
### Removed
18+
* *Nothing*
19+
20+
### Fixed
21+
* [#61](https://github.com/shlinkio/shlink-api-spec-ui/issues/61) Fixed error when trying to load Async API spec fo v2.10.0 due to wrong version comparison.
22+
23+
724
## [1.9.0] - 2021-12-11
825
### Added
926
* [#57](https://github.com/shlinkio/shlink-api-spec-ui/issues/57) Added support to download oas spec from shlinkio/shlink-open-api-specs repo for versions that support it.

src/pages/async-api.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { FunctionComponent } from 'react';
2+
import { compare } from 'compare-versions';
23
import { useShlinkSpecUrl } from '../helpers';
34
import LoadingSpec from '../components/LoadingSpec';
45
import Layout from '../components/Layout';
@@ -8,7 +9,7 @@ const MIN_ASYNC_API_VERSION = '2.2.0';
89

910
const AsyncApi: FunctionComponent = () => {
1011
const { url, versionToLoad, tags, tagsError } = useShlinkSpecUrl('async-api');
11-
const versionIsTooSmall = versionToLoad && versionToLoad < MIN_ASYNC_API_VERSION;
12+
const versionIsTooSmall = versionToLoad && compare(versionToLoad, MIN_ASYNC_API_VERSION, '<');
1213

1314
return (
1415
<Layout tags={tags}>

0 commit comments

Comments
 (0)