From ee6b1d9c4cf3abf93e9f89c26a17b4d1fc93c333 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Wed, 4 Dec 2019 01:46:50 +0100 Subject: [PATCH] Albums: Improve search result notification #15 Signed-off-by: Michael Mayer --- frontend/src/pages/albums/view.vue | 8 +++++++- frontend/src/pages/photos.vue | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/albums/view.vue b/frontend/src/pages/albums/view.vue index c3a670503..af96e2196 100644 --- a/frontend/src/pages/albums/view.vue +++ b/frontend/src/pages/albums/view.vue @@ -186,7 +186,13 @@ this.scrollDisabled = (response.models.length < this.pageSize); if (this.scrollDisabled) { - this.$notify.info(this.results.length + ' photos found'); + if (!this.results.length) { + this.$notify.warning("No photos found"); + } else if (this.results.length === 1) { + this.$notify.info("One photo found"); + } else { + this.$notify.info(this.results.length + " photos found"); + } } else { this.$notify.info('More than 50 photos found'); diff --git a/frontend/src/pages/photos.vue b/frontend/src/pages/photos.vue index 29d3bf5a4..092d5baa0 100644 --- a/frontend/src/pages/photos.vue +++ b/frontend/src/pages/photos.vue @@ -182,7 +182,13 @@ this.scrollDisabled = (response.models.length < this.pageSize); if (this.scrollDisabled) { - this.$notify.info(this.results.length + ' photos found'); + if (!this.results.length) { + this.$notify.warning("No photos found"); + } else if (this.results.length === 1) { + this.$notify.info("One photo found"); + } else { + this.$notify.info(this.results.length + " photos found"); + } } else { this.$notify.info('More than 50 photos found');