Skip to content

Commit

Permalink
Merge pull request #4606 from FlipWarthog/PV4605
Browse files Browse the repository at this point in the history
Fix #4605: Use DocSearch in non prod env too
  • Loading branch information
tugcekucukoglu authored Oct 13, 2023
2 parents 80fd699 + 53ee29d commit df4b10b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion layouts/AppTopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,23 @@ export default {
container: '#docsearch',
appId: '01CMUF4W4R',
indexName: 'primevue',
apiKey: '9bb5939e36897b26ff7de5b7b64d6c43'
apiKey: '9bb5939e36897b26ff7de5b7b64d6c43',
transformItems: (items) => {
const isLocalhost = process.env.NODE_ENV !== 'production';
return items.map((item) => {
if (isLocalhost) {
const url = new URL(item.url);
url.protocol = window.location.protocol;
url.hostname = window.location.hostname;
url.port = window.location.port;
item.url = url.toString();
}
return item;
});
}
});
},
beforeUnmount() {
Expand Down

0 comments on commit df4b10b

Please sign in to comment.