@salesforcedevs/dx-components 0.10.1-alpha.120 → 0.10.1-alpha.124

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.120",
3
+ "version": "0.10.1-alpha.124",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -125,19 +125,22 @@ 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)
128
129
  if (!stringified) {
129
130
  return;
130
131
  }
131
132
 
132
133
  try {
134
+ console.log('USE SESSION STORAGE')
133
135
  const json = JSON.parse(stringified);
134
136
  const hasSameConfig = json.coveoAdvancedQueryConfig
135
- .entries()
136
- .every(
137
- ([key, value]: [string, string]) =>
138
- this.coveoAdvancedQueryConfig[key] === value
137
+ .entries()
138
+ .every(
139
+ ([key, value]: [string, string]) =>
140
+ this.coveoAdvancedQueryConfig[key] === value
139
141
  );
140
- const hasSameQuery = json?.state?.query?.q === this.value;
142
+ const hasSameQuery = json?.state?.query?.q === this.value;
143
+ console.log(json.coveoAdvancedQueryConfig, this.coveoAdvancedQueryConfig, hasSameConfig)
141
144
  if (hasSameConfig && hasSameQuery) {
142
145
  console.log(
143
146
  "valid session storage found for value =",
@@ -145,9 +148,8 @@ export default class SidebarSearch extends LightningElement {
145
148
  );
146
149
  this.preloadedState = json?.state;
147
150
  }
148
- } catch (_) {
149
- // Swallow error; no parseable preloaded state
150
- // TODO: might want to clear sessionStorage, alert user(?), etc.
151
+ } catch (e) {
152
+ console.error(e)
151
153
  }
152
154
  }
153
155