mirror of https://github.com/Lissy93/dashy.git
🚑 [67174449] Fixes version checking
This commit is contained in:
parent
522bbca427
commit
a8cf946f76
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-version">
|
<div class="app-version" v-if="isVersionValid()">
|
||||||
<!-- Current Version -->
|
<!-- Current Version -->
|
||||||
<p>
|
<p>
|
||||||
{{ $t('updates.app-version-note') }} {{ appVersion }}
|
{{ $t('updates.app-version-note') }} {{ appVersion }}
|
||||||
|
@ -31,6 +31,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import ErrorHandler from '@/utils/ErrorHandler';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AppInfoModal',
|
name: 'AppInfoModal',
|
||||||
|
@ -76,6 +77,17 @@ export default {
|
||||||
if (difference > 5) this.veryOutOfDate = true;
|
if (difference > 5) this.veryOutOfDate = true;
|
||||||
return difference <= 0;
|
return difference <= 0;
|
||||||
},
|
},
|
||||||
|
/* Checks that the input version is correctly parsed */
|
||||||
|
isVersionValid() {
|
||||||
|
const isValid = !Number.isNaN(parseInt(this.appVersion.replaceAll('.', ''), 10));
|
||||||
|
if (!isValid) { // If invalid, then record an error
|
||||||
|
ErrorHandler(
|
||||||
|
'Unable to check for updates, because current version is unavailible.'
|
||||||
|
+ ` ${this.appVersion} is not a valid version.`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return isValid;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
|
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
|
||||||
|
|
||||||
// Get current version
|
// Get current version
|
||||||
process.env.VUE_APP_VERSION = require('./package.json');
|
process.env.VUE_APP_VERSION = require('./package.json').version;
|
||||||
|
|
||||||
// Specify and export the main Vue app config
|
// Specify and export the main Vue app config
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
Loading…
Reference in New Issue