From 3e4747e4b001c28408aa47816c439b02f8c6dd0c Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Tue, 4 Apr 2023 20:50:47 +0200 Subject: [PATCH] webapp: Only cut first char of git_hash if it equals "g" --- webapp/src/components/FirmwareInfo.vue | 4 ++-- webapp/src/views/SystemInfoView.vue | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/webapp/src/components/FirmwareInfo.vue b/webapp/src/components/FirmwareInfo.vue index 7a127c10..9eda8935 100644 --- a/webapp/src/components/FirmwareInfo.vue +++ b/webapp/src/components/FirmwareInfo.vue @@ -17,9 +17,9 @@ {{ $t('firmwareinfo.FirmwareVersion') }} - - {{ systemStatus.git_hash?.substring(1) }} + {{ systemStatus.git_hash }} diff --git a/webapp/src/views/SystemInfoView.vue b/webapp/src/views/SystemInfoView.vue index cb1bd449..7150aa1b 100644 --- a/webapp/src/views/SystemInfoView.vue +++ b/webapp/src/views/SystemInfoView.vue @@ -50,8 +50,9 @@ export default defineComponent({ }) }, getUpdateInfo() { + this.systemDataList.git_hash = this.systemDataList.git_hash?.substring(0, 1) == 'g' ? this.systemDataList.git_hash?.substring(1) : this.systemDataList.git_hash; const fetchUrl = "https://api.github.com/repos/tbnobody/OpenDTU/compare/" - + this.systemDataList.git_hash?.substring(1) + "...HEAD"; + + this.systemDataList.git_hash + "...HEAD"; fetch(fetchUrl) .then((response) => {