Skip to content

Commit

Permalink
Merge pull request #82 from ddjnw1yu/data-object-update
Browse files Browse the repository at this point in the history
Replace global variable with markRaw
  • Loading branch information
alan-wu authored Jul 25, 2024
2 parents 0438c3e + 2874bd4 commit 1c55ba9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/components/SearchFilters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export default {
},
data: function () {
return {
algoliaClient: undefined,
cascaderIsReady: false,
previousShowAllChecked: {
species: false,
Expand Down Expand Up @@ -776,11 +777,11 @@ export default {
},
},
mounted: function () {
this.algoliaClient = new AlgoliaClient(
this.algoliaClient = markRaw(new AlgoliaClient(
this.envVars.ALGOLIA_ID,
this.envVars.ALGOLIA_KEY,
this.envVars.PENNSIEVE_API_LOCATION
)
))
this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX)
this.populateCascader().then(() => {
this.cascaderIsReady = true
Expand Down
6 changes: 4 additions & 2 deletions src/components/SidebarContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ import EventBus from './EventBus.js'
import { AlgoliaClient } from '../algolia/algolia.js'
import { getFilters, facetPropPathMapping } from '../algolia/utils.js'
import { markRaw } from 'vue'
// handleErrors: A custom fetch error handler to recieve messages from the server
// even when an error is found
Expand Down Expand Up @@ -142,6 +143,7 @@ export default {
data: function () {
return {
...this.entry,
algoliaClient: undefined,
bodyStyle: {
flex: '1 1 auto',
'flex-flow': 'column',
Expand Down Expand Up @@ -442,11 +444,11 @@ export default {
},
mounted: function () {
// initialise algolia
this.algoliaClient = new AlgoliaClient(
this.algoliaClient = markRaw(new AlgoliaClient(
this.envVars.ALGOLIA_ID,
this.envVars.ALGOLIA_KEY,
this.envVars.PENNSIEVE_API_LOCATION
)
))
this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX)
this.openSearch(this.filter, this.searchInput)
},
Expand Down

0 comments on commit 1c55ba9

Please sign in to comment.