@salesforcedevs/dx-components 0.10.1-alpha.126 → 0.10.1-alpha.127

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.126",
3
+ "version": "0.10.1-alpha.127",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -33,7 +33,7 @@ export default class SidebarSearch extends LightningElement {
33
33
  @api coveoPublicAccessToken!: string;
34
34
  @api coveoSearchHub!: string;
35
35
  @api
36
- get coveoAdvancedQueryConfig() {
36
+ get coveoAdvancedQueryConfig(): { [key: string]: any } {
37
37
  return this._coveoAdvancedQueryConfig;
38
38
  }
39
39
  set coveoAdvancedQueryConfig(value) {
@@ -125,35 +125,31 @@ export default class SidebarSearch extends LightningElement {
125
125
 
126
126
  private initializeUserSession() {
127
127
  const stringified = window.sessionStorage.getItem(SESSION_KEY);
128
- console.log("initializing", stringified);
129
128
  if (!stringified) {
130
129
  return;
131
130
  }
132
131
 
133
132
  try {
134
- console.log("USE SESSION STORAGE");
135
133
  const json = JSON.parse(stringified);
136
134
  const hasSameConfig = Object.entries(
137
135
  json.coveoAdvancedQueryConfig
138
136
  ).every(
139
- ([key, value]: [string, string]) =>
137
+ ([key, value]: [string, any]) =>
140
138
  this.coveoAdvancedQueryConfig[key] === value
141
139
  );
142
140
  const hasSameQuery = json?.state?.query?.q === this.value;
143
- console.log(
144
- json.coveoAdvancedQueryConfig,
145
- this.coveoAdvancedQueryConfig,
146
- hasSameConfig
147
- );
148
141
  if (hasSameConfig && hasSameQuery) {
149
142
  console.log(
150
143
  "valid session storage found for value =",
151
144
  this.value
152
145
  );
153
146
  this.preloadedState = json?.state;
147
+ } else {
148
+ window.sessionStorage.removeItem(SESSION_KEY);
154
149
  }
155
150
  } catch (e) {
156
151
  console.error(e);
152
+ window.sessionStorage.removeItem(SESSION_KEY);
157
153
  }
158
154
  }
159
155