From c1176fa24d36fd3ca0e06ac6192ccd38f6751312 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sun, 26 Nov 2023 20:08:30 -0700 Subject: [PATCH] clear search results on restarting search --- project.task.yaml | 2 ++ src/views/DiscoverView.vue | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/project.task.yaml b/project.task.yaml index 054fec66..6c7d3ac0 100644 --- a/project.task.yaml +++ b/project.task.yaml @@ -7,6 +7,7 @@ tasks: - 40 notifications : - push, where we trigger a ServiceWorker(?) in the app to reach out and check for new data assignee:matthew +- .3 on DiscoverView QuickSearch, the 'keyup.enter' only runs searchAll, so do the right thing for searchLocal - .5 allow to manage their notifications even without an identity - .5 bug - on the discover page, enter a search term and search and see a duplicate project show at the end of the list - 01 Ensure each action sent to the server has a confirmation - eg registration (ie a toast something that dismisses after 5-10s) @@ -49,6 +50,7 @@ tasks: - 08 convert to cleaner implementation (maybe Drie -- https://github.com/janvorisek/drie) - Release Minimum Viable Product : + - .5 deploy endorser.ch server above v 3.4.3 (to get plan searches by names as well as descriptions) - 08 thorough testing for errors & edge cases - 01 ensure ability to recover server remotely, and add redundant access - Turn off stats-world or ensure it's usable (eg. cannot zoom out too far and lose world, cannot screenshot). diff --git a/src/views/DiscoverView.vue b/src/views/DiscoverView.vue index 7af51f16..637e71d1 100644 --- a/src/views/DiscoverView.vue +++ b/src/views/DiscoverView.vue @@ -213,6 +213,11 @@ export default class DiscoverView extends Vue { } public async searchAll(beforeId?: string) { + if (!beforeId) { + // this was an initial search so clear any previous results + this.projects = []; + } + let queryParams = "claimContents=" + encodeURIComponent(this.searchTerms); if (beforeId) { @@ -280,8 +285,14 @@ export default class DiscoverView extends Vue { return; } + if (!beforeId) { + // this was an initial search so clear any previous results + this.projects = []; + } + const claimContents = "claimContents=" + encodeURIComponent(this.searchTerms); + let queryParams = [ claimContents, "minLocLat=" + this.searchBox.bbox.minLat,