@salesforcedevs/dx-components 0.10.1-alpha.119 → 0.10.1-alpha.122

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.119",
3
+ "version": "0.10.1-alpha.122",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -96,7 +96,8 @@ export default class SidebarSearch extends LightningElement {
96
96
  }
97
97
 
98
98
  renderedCallback() {
99
- // 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
100
101
  if (this.hasCorrectCoveoConfig && !this.engine) {
101
102
  console.log("coveo config is good");
102
103
  this.initializeUserSession();
@@ -124,20 +125,21 @@ export default class SidebarSearch extends LightningElement {
124
125
 
125
126
  private initializeUserSession() {
126
127
  const stringified = window.sessionStorage.getItem(SESSION_KEY);
128
+ console.log('initializing', stringified)
127
129
  if (!stringified) {
128
130
  return;
129
131
  }
130
132
 
131
133
  try {
132
134
  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
- );
135
+ console.log(json.coveoAdvancedQueryConfig, this.coveoAdvancedQueryConfig, hasSameConfig)
136
+ const hasSameConfig = json.coveoAdvancedQueryConfig
137
+ .entries()
138
+ .every(
139
+ ([key, value]: [string, string]) =>
140
+ this.coveoAdvancedQueryConfig[key] === value
141
+ );
142
+
141
143
  const hasSameQuery = json?.state?.query?.q === this.value;
142
144
  if (hasSameConfig && hasSameQuery) {
143
145
  console.log(