@salesforcedevs/dx-components 0.10.1-alpha.118 → 0.10.1-alpha.121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "0.10.1-alpha.118",
3
+ "version": "0.10.1-alpha.121",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -93,13 +93,14 @@ export default class SidebarSearch extends LightningElement {
93
93
 
94
94
  this.updateRecentSearches();
95
95
  this.value = getSidebarSearchParams() || "";
96
- this.initializeUserSession();
97
96
  }
98
97
 
99
98
  renderedCallback() {
100
- // in prod some of the attributes seem to arrive later, so I put this coveo startup flow here
99
+ // in prod some of the critical coveo configuration attributes seem to arrive later
100
+ // so I needed to put this coveo startup flow here where we can wait for them to arrive
101
101
  if (this.hasCorrectCoveoConfig && !this.engine) {
102
102
  console.log("coveo config is good");
103
+ this.initializeUserSession();
103
104
  this.initializeCoveo();
104
105
  } else if (!this.hasCorrectCoveoConfig) {
105
106
  console.error(
@@ -130,14 +131,12 @@ export default class SidebarSearch extends LightningElement {
130
131
 
131
132
  try {
132
133
  const json = JSON.parse(stringified);
133
- const hasSameConfig =
134
- json.coveoAdvancedQueryConfig ===
135
- JSON.stringify(this.coveoAdvancedQueryConfig);
136
- console.log(
137
- json.coveoAdvancedQueryConfig,
138
- this.coveoAdvancedQueryConfig,
139
- hasSameConfig
140
- );
134
+ const hasSameConfig = json.coveoAdvancedQueryConfig
135
+ .entries()
136
+ .every(
137
+ ([key, value]: [string, string]) =>
138
+ this.coveoAdvancedQueryConfig[key] === value
139
+ );
141
140
  const hasSameQuery = json?.state?.query?.q === this.value;
142
141
  if (hasSameConfig && hasSameQuery) {
143
142
  console.log(