Skip to content

Commit

Permalink
Remove unused variables and make sure search is performed correctly w…
Browse files Browse the repository at this point in the history
…hen the app is mounted.
  • Loading branch information
alan-wu committed Jan 26, 2023
1 parent 89cfe13 commit bcc1ec1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
5 changes: 4 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ export default {
neuronSearch: function(){
this.$refs.sideBar.openNeuronSearch('ilxtr:neuron-type-keast-10')
}
}
},
mounted: function() {
console.log("mounted app")
},
}
</script>

Expand Down
23 changes: 1 addition & 22 deletions src/components/SideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,6 @@ locale.use(lang);
Vue.use(Drawer);
Vue.use(Icon);
var initial_state = {
searchInput: "",
lastSearch: "",
results: [],
drawerOpen: false,
numberOfHits: 0,
filter:{},
filterFacet: undefined,
loadingCards: false,
numberPerPage: 10,
page: 1,
pageModel: 1,
start: 0,
hasSearched: false,
sciCrunchError: false
}
export default {
components: {SidebarContent, Tabs },
name: "SideBar",
Expand All @@ -77,10 +60,6 @@ export default {
type: Boolean,
default: false
},
entry: {
type: Object,
default: () => (initial_state)
},
envVars: {
type: Object,
default: () => {}
Expand All @@ -100,7 +79,7 @@ export default {
},
data: function () {
return {
...this.entry,
drawerOpen: false,
}
},
methods: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/SidebarContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ export default {
// initialise algolia
this.algoliaClient = new AlgoliaClient(this.envVars.ALGOLIA_ID, this.envVars.ALGOLIA_KEY, this.envVars.PENNSIEVE_API_LOCATION);
this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX);
this.openSearch(undefined, '');
this.openSearch(this.filter, this.searchInput);
},
created: function() {
//Create non-reactive local variables
Expand Down

0 comments on commit bcc1ec1

Please sign in to comment.