@salesforcedevs/dx-components 0.10.1-alpha.122 → 0.10.1-alpha.126
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
|
@@ -125,22 +125,26 @@ export default class SidebarSearch extends LightningElement {
|
|
|
125
125
|
|
|
126
126
|
private initializeUserSession() {
|
|
127
127
|
const stringified = window.sessionStorage.getItem(SESSION_KEY);
|
|
128
|
-
console.log(
|
|
128
|
+
console.log("initializing", stringified);
|
|
129
129
|
if (!stringified) {
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
try {
|
|
134
|
+
console.log("USE SESSION STORAGE");
|
|
134
135
|
const json = JSON.parse(stringified);
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
);
|
|
142
|
-
|
|
136
|
+
const hasSameConfig = Object.entries(
|
|
137
|
+
json.coveoAdvancedQueryConfig
|
|
138
|
+
).every(
|
|
139
|
+
([key, value]: [string, string]) =>
|
|
140
|
+
this.coveoAdvancedQueryConfig[key] === value
|
|
141
|
+
);
|
|
143
142
|
const hasSameQuery = json?.state?.query?.q === this.value;
|
|
143
|
+
console.log(
|
|
144
|
+
json.coveoAdvancedQueryConfig,
|
|
145
|
+
this.coveoAdvancedQueryConfig,
|
|
146
|
+
hasSameConfig
|
|
147
|
+
);
|
|
144
148
|
if (hasSameConfig && hasSameQuery) {
|
|
145
149
|
console.log(
|
|
146
150
|
"valid session storage found for value =",
|
|
@@ -148,9 +152,8 @@ export default class SidebarSearch extends LightningElement {
|
|
|
148
152
|
);
|
|
149
153
|
this.preloadedState = json?.state;
|
|
150
154
|
}
|
|
151
|
-
} catch (
|
|
152
|
-
|
|
153
|
-
// TODO: might want to clear sessionStorage, alert user(?), etc.
|
|
155
|
+
} catch (e) {
|
|
156
|
+
console.error(e);
|
|
154
157
|
}
|
|
155
158
|
}
|
|
156
159
|
|