Skip to content

Commit ad53fe3

Browse files
committed
fix: remove searchLoad if statement
1 parent 7305267 commit ad53fe3

1 file changed

Lines changed: 12 additions & 16 deletions

File tree

src/components/DocSidebar.vue

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ export default {
5757
sidebar: {
5858
height: 0,
5959
top: 0
60-
},
61-
searchLoad: false
60+
}
6261
};
6362
},
6463
props: {
@@ -75,21 +74,18 @@ export default {
7574
this.$router.push(link);
7675
},
7776
loadDocSearch() {
78-
if (this.searchLoad) {
79-
import("docsearch.js").then(({ default: docsearch }) => {
80-
docsearch({
81-
apiKey: "951a5443c76379c2aa75205eb62b2f7c",
82-
indexName: "codecarrot-thermal",
83-
inputSelector: "#search_input",
84-
debug: false, // process.env.NODE_ENV === 'development'
85-
algoliaOptions: {
86-
hitsPerPage: 5
87-
}
88-
});
89-
this.searchLoad = true;
90-
this.$refs.search_input.focus();
77+
import("docsearch.js").then(({ default: docsearch }) => {
78+
docsearch({
79+
apiKey: "951a5443c76379c2aa75205eb62b2f7c",
80+
indexName: "codecarrot-thermal",
81+
inputSelector: "#search_input",
82+
debug: false, // process.env.NODE_ENV === 'development'
83+
algoliaOptions: {
84+
hitsPerPage: 5
85+
}
9186
});
92-
}
87+
this.$refs.search_input.focus();
88+
});
9389
},
9490
toggleSidebar() {
9591
this.sidebarToggleable = !this.sidebarToggleable;

0 commit comments

Comments
 (0)