Skip to content

Commit

Permalink
fix(searches): Disable download when no rows are available.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmussig committed Mar 26, 2023
1 parent 35b00fa commit 6d18ef3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pages/searches.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

<div class="d-flex flex-row mt-3">
<v-btn
:disabled="loading"
:disabled="loading || !hasRows"
:href="downloadUrlTsv"
depressed
small
Expand All @@ -76,7 +76,7 @@
</v-btn>

<v-btn
:disabled="loading"
:disabled="loading || !hasRows"
:href="downloadUrlCsv"
class="ml-3"
depressed
Expand All @@ -101,6 +101,7 @@
dense
loading-text="Loading..."
multi-sort
@current-items="onDataTableChange"
>

<!-- Rows -->
Expand Down Expand Up @@ -210,7 +211,9 @@ export default Vue.extend({
options: ({page: 1} as DataOptions),
totalRows: 0,
lastSearchRequest: {} as SearchGtdbRequest
lastSearchRequest: {} as SearchGtdbRequest,
hasRows: false,
}),
Expand Down Expand Up @@ -259,6 +262,9 @@ export default Vue.extend({
}
},
methods: {
onDataTableChange() {
this.hasRows = this.rows.length > 0;
},
getParamsFromUrl() {
// Gets parameters from the URL, note: includes default parameters as well
// TODO: Define an interface
Expand Down

0 comments on commit 6d18ef3

Please sign in to comment.