Skip to content

Commit

Permalink
Use the count as indicator for results
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 22, 2024
1 parent 99921b6 commit d243228
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions assets/vue/ClassifySnippets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</form>
</div>
<div class="col-4">
<p class="text-right">{{ total }} snippets found</p>
<p v-if="total !== null" class="text-right">{{ total }} snippets found</p>
</div>
</div>
<div v-if="snippets === null">
Expand Down Expand Up @@ -122,7 +122,6 @@
><i class="fas fa-angle-up"></i
></a>
</div>
<div v-else>There are currently no snippets to display</div>
</div>
</template>

Expand All @@ -136,7 +135,7 @@ export default {
params: {isClassified: true, isApproved: false, isLegal: true, notLegal: true, before: 0},
snippets: null,
snippetUrl: '/snippets/meta',
total: 0
total: null
};
},
mounted() {
Expand All @@ -162,7 +161,7 @@ export default {
const data = await res.json();
const snippets = data.snippets;
if (this.total < data.total) this.total = data.total;
if (this.total === null || this.total < data.total) this.total = data.total;
for (const snippet of snippets) {
snippet.buttonPressed = null;
Expand Down Expand Up @@ -202,7 +201,7 @@ export default {
this.getSnippets();
},
refreshPage() {
this.total = 0;
this.total = null;
this.snippets = null;
this.params.before = 0;
this.getSnippets();
Expand Down

0 comments on commit d243228

Please sign in to comment.