From 431105ae4d4815a290eeee5233c4b494430a7e15 Mon Sep 17 00:00:00 2001 From: patrick Date: Sun, 28 Feb 2021 20:35:14 +0100 Subject: Fixes issue on files within directories. Reset tab view on fileinfo change - NC 21 only. --- src/views/ChecksumTab.vue | 6 ++++-- src/views/ChecksumTab20.vue | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/views/ChecksumTab.vue b/src/views/ChecksumTab.vue index f08306e..3465efd 100644 --- a/src/views/ChecksumTab.vue +++ b/src/views/ChecksumTab.vue @@ -90,6 +90,7 @@ export default { * @param {Object} fileInfo the current file FileInfo. */ update(fileInfo) { + this.resetState() this.fileInfo = fileInfo }, @@ -113,7 +114,7 @@ export default { */ getChecksum(algorithmType) { const url = generateUrl('/apps/checksum/check') - const params = { source: this.fileInfo.path + this.fileInfo.name, type: algorithmType } + const params = { source: `${this.fileInfo.path}/${this.fileInfo.name}`, type: algorithmType } axios.get(url, { params }).then(response => { this.loading = false this.hash = response.data.msg @@ -127,7 +128,8 @@ export default { */ resetState() { this.loading = false - this.algorithm = '' + this.algorithm = algorithms[0] + this.hash = '' }, }, } diff --git a/src/views/ChecksumTab20.vue b/src/views/ChecksumTab20.vue index 442f515..bbd972b 100644 --- a/src/views/ChecksumTab20.vue +++ b/src/views/ChecksumTab20.vue @@ -139,7 +139,7 @@ export default { */ getChecksum(algorithmType) { const url = generateUrl('/apps/checksum/check') - const params = { source: this.fileInfo.path + this.fileInfo.name, type: algorithmType } + const params = { source: `${this.fileInfo.path}/${this.fileInfo.name}`, type: algorithmType } axios.get(url, { params }).then(response => { this.loading = false this.hash = response.data.msg @@ -153,7 +153,8 @@ export default { */ resetState() { this.loading = false - this.algorithm = '' + this.algorithm = algorithms[0] + this.hash = '' }, }, } -- cgit v1.2.3