From 69dc0d20706ed41e5ecdbb77515066d8a7d7703b Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Fri, 19 Jun 2020 22:12:03 +0200
Subject: viewer: code update (no functional change)

Types { [x: T]: R } updated to Record<T, R>
Methods in template updated to getters (computed in VueJS), which are reactive and cached
Code formatting
---
 viewer/src/views/GallerySearch.vue | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'viewer/src/views/GallerySearch.vue')

diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue
index dfaa5d3..4b98cea 100644
--- a/viewer/src/views/GallerySearch.vue
+++ b/viewer/src/views/GallerySearch.vue
@@ -18,7 +18,7 @@
 -->
 
 <template>
-  <ld-gallery :items="items()" :noresult="noResult()" />
+  <ld-gallery :items="items" :noresult="noResult" />
 </template>
 
 <script lang="ts">
@@ -41,14 +41,14 @@ export default class GalleryPicture extends Vue {
     this.$galleryStore.setCurrentSearch([]);
   }
 
-  items() {
+  get items() {
     const searchResult = IndexSearch.search(this.$galleryStore.currentSearch);
     const filteredByPath = searchResult.filter(item => item.path.startsWith(this.path));
     this.otherCount = searchResult.length - filteredByPath.length;
     return filteredByPath;
   }
 
-  noResult() {
+  get noResult() {
     return this.$tc("search.no-result-fmt", this.otherCount, [this.otherCount]);
   }
 }
-- 
cgit v1.2.3

