Skip to content

Commit

Permalink
Fix: update notification not working for minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
psi-4ward committed Mar 27, 2020
1 parent 0cbbebc commit 48b6e2d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"file-saver": "^2.0.2",
"highcharts": "^7.1.3",
"quasar": "^1.9.10",
"semver-compare": "^1.0.0",
"vue": "^2.6.11",
"vue-router": "^3.1.6"
},
Expand Down
5 changes: 2 additions & 3 deletions ui/src/views/Info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
</template>

<script>
import semverCompare from 'semver-compare';
import FlagChip from '../components/FlagChip';
export default {
Expand Down Expand Up @@ -198,9 +199,7 @@
const res = await fetch('https://api.github.com/repos/psi-4ward/AskSinAnalyzerXS/releases/latest');
const latestVersion = (await res.json()).tag_name;
const currentVersion = this.$root.version;
const [aU, aL] = latestVersion.split('.');
const [bU, bL] = currentVersion.split('.');
if (aU > bU || aU === bU && aL > bL) {
if (semverCompare(latestVersion, currentVersion)) {
this.updateVersion = latestVersion;
}
}
Expand Down

0 comments on commit 48b6e2d

Please sign in to comment.