diff --git a/app/resources/js/components/file-info-modal.js b/app/resources/js/components/file-info-modal.js index e5d7b15..cad72ac 100644 --- a/app/resources/js/components/file-info-modal.js +++ b/app/resources/js/components/file-info-modal.js @@ -3,21 +3,19 @@ import axios from 'axios'; export default () => ({ error: null, filePath: 'file.info', - hashes: { - md5: '••••••••••••••••••••••••••••••••', - sha1: '••••••••••••••••••••••••••••••••••••••••', - sha256: '••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••' - }, - loading: false, + hashes: null, visible: false, get title() { return this.filePath.split('/').pop(); }, + get loading() { + return this.hashes === null; + }, + async show(filePath) { this.filePath = filePath; - this.loading = true; this.visible = true; try { @@ -28,12 +26,11 @@ export default () => ({ } this.hashes = response.data.hashes; - this.loading = false; }, hide() { this.visible = false; - this.loading = false; + this.hashes = null; this.error = null; } }); diff --git a/app/views/components/file-info-modal.twig b/app/views/components/file-info-modal.twig index 1fff4a6..3d58d02 100644 --- a/app/views/components/file-info-modal.twig +++ b/app/views/components/file-info-modal.twig @@ -1,8 +1,8 @@