From c175db32132201cefec699b69f71fb23bdd2c687 Mon Sep 17 00:00:00 2001
From: pacien
Date: Fri, 8 May 2020 19:03:09 +0200
Subject: viewer/LdDownload: fix item type and remove getters

For consistency.
---
 viewer/src/components/LdDownload.vue | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

(limited to 'viewer/src/components/LdDownload.vue')

diff --git a/viewer/src/components/LdDownload.vue b/viewer/src/components/LdDownload.vue
index 3b13e99..f86d455 100644
--- a/viewer/src/components/LdDownload.vue
+++ b/viewer/src/components/LdDownload.vue
@@ -20,10 +20,10 @@
 
 <template>
   <div :class="$style.container">
-    <a :class="$style.content" :download="itemFileName" :href="itemDownloadUrl">
+    <a :class="$style.content" :download="itemFileName()" :href="itemDownloadUrl()">
       <!-- TODO: show thumbnail instead of this generic file download icon? -->
       <fa-icon :class="$style.icon" icon="file-download" size="6x" />
-      <div>{{ $t("download.download-file-fmt", [itemFileName]) }}</div>
+      <div>{{ $t("download.download-file-fmt", [itemFileName()]) }}</div>
     </a>
   </div>
 </template>
@@ -32,19 +32,19 @@
 import { Component, Prop, Vue } from "vue-property-decorator";
 
 @Component export default class LdDownload extends Vue {
-  @Prop({ required: true }) readonly item!: Gallery.Item;
+  @Prop({ required: true }) readonly item!: Gallery.Other;
 
-  get itemResource(): string {
-    return (this.item.properties as Gallery.OtherProperties).resource;
+  itemResource(): string {
+    return this.item.properties.resource;
   }
 
-  get itemFileName(): string {
-    const timeStamped = this.itemResource.split("/").pop() ?? "";
+  itemFileName(): string {
+    const timeStamped = this.itemResource().split("/").pop() ?? "";
     return timeStamped.split("?")[0];
   }
 
-  get itemDownloadUrl(): string {
-    return this.$galleryStore.resourceRoot + this.itemResource;
+  itemDownloadUrl(): string {
+    return this.$galleryStore.resourceRoot + this.itemResource();
   }
 }
 </script>
-- 
cgit v1.2.3

