diff --git a/src/views/DiscoverView.vue b/src/views/DiscoverView.vue index 57350178e..c770440c5 100644 --- a/src/views/DiscoverView.vue +++ b/src/views/DiscoverView.vue @@ -41,8 +41,10 @@ Nearby {{ localCount > -1 ? localCount : "?" }} + {{ localCount > -1 ? localCount : "?" }} +
  • @@ -59,8 +61,10 @@ Anywhere {{ remoteCount > -1 ? remoteCount : "?" }} + {{ remoteCount > -1 ? remoteCount : "?" }} +
  • @@ -156,12 +160,12 @@ export default class DiscoverView extends Vue { apiServer = ""; searchTerms = ""; projects: ProjectData[] = []; + isLoading = false; isLocalActive = true; isRemoteActive = false; localCount = -1; remoteCount = -1; searchBox: { name: string; bbox: BoundingBox } | null = null; - isLoading = false; // make this function available to the Vue template didInfo = didInfo; @@ -188,6 +192,11 @@ export default class DiscoverView extends Vue { } } + public resetCounts() { + this.localCount = -1; + this.remoteCount = -1; + } + public async searchSelected() { if (this.isLocalActive) { await this.searchLocal(); @@ -221,6 +230,8 @@ export default class DiscoverView extends Vue { } public async searchAll(beforeId?: string) { + this.resetCounts(); + if (!beforeId) { // this was an initial search so clear any previous results this.projects = []; @@ -288,6 +299,8 @@ export default class DiscoverView extends Vue { } public async searchLocal(beforeId?: string) { + this.resetCounts(); + if (!this.searchBox) { this.projects = []; return;