Skip to content

Commit

Permalink
fix url query error related to first available tab
Browse files Browse the repository at this point in the history
  • Loading branch information
jsheunis committed Apr 15, 2024
1 parent 5ffe81b commit 70df623
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions datalad_catalog/catalog/assets/app_component_dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ const datasetView = () =>
this.updateURLQueryString(this.$route, newTabIndex)
},
updateURLQueryString(current_route, tab_index) {
if (tab_index) {
if (tab_index >= 0) {
query_tab = this.selectedDataset.available_tabs[tab_index];
} else {
const query = Object.assign({}, current_route.query);
Expand Down Expand Up @@ -688,8 +688,6 @@ const datasetView = () =>
this.$root.selectedDataset.keywords = this.$root.selectedDataset.keywords
? this.$root.selectedDataset.keywords
: [];
this.dataset_ready = true;

if (
this.$root.selectedDataset.hasOwnProperty("subdatasets") &&
this.$root.selectedDataset.subdatasets instanceof Array &&
Expand Down Expand Up @@ -806,9 +804,12 @@ const datasetView = () =>
available_tabs_lower,
this.$root.selectedDataset.config?.dataset_options?.default_tab
)
this.dataset_ready = true;
next();
},
async created() {
this.dataset_ready = false;
this.subdatasets_ready = false;
// fetch superfile in order to set id and version on $root
homefile = metadata_dir + "/super.json";
homeresponse = await fetch(homefile);
Expand Down Expand Up @@ -856,7 +857,6 @@ const datasetView = () =>
return;
}
app.selectedDataset = JSON.parse(text);
this.dataset_ready = true;
if (
this.$root.selectedDataset.hasOwnProperty("subdatasets") &&
this.$root.selectedDataset.subdatasets instanceof Array &&
Expand Down Expand Up @@ -956,6 +956,7 @@ const datasetView = () =>
available_tabs_lower,
this.$root.selectedDataset.config?.dataset_options?.default_tab
)
this.dataset_ready = true;
},
mounted() {
this.tag_options_filtered = this.tag_options;
Expand Down

0 comments on commit 70df623

Please sign in to comment.