Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

:ambulance: [67174449] Fixes version checking

Alicia Sykesa8cf946f7610
diff --git a/src/components/Configuration/AppVersion.vue b/src/components/Configuration/AppVersion.vue
index 698e8a83..68941361 100644
--- a/src/components/Configuration/AppVersion.vue
+++ b/src/components/Configuration/AppVersion.vue
@@ -1,5 +1,5 @@
<template>
- <div class="app-version">
+ <div class="app-version" v-if="isVersionValid()">
<!-- Current Version -->
<p>
{{ $t('updates.app-version-note') }} {{ appVersion }}
@@ -31,6 +31,7 @@
<script>
import axios from 'axios';
+import ErrorHandler from '@/utils/ErrorHandler';
export default {
name: 'AppInfoModal',
@@ -76,6 +77,17 @@ export default {
if (difference > 5) this.veryOutOfDate = true;
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>
diff --git a/vue.config.js b/vue.config.js
index 7b9295a7..a25d4519 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -5,7 +5,7 @@
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
// 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
module.exports = {