@salesforcedevs/dx-components 1.3.92-alpha-006-localstorage → 1.3.92-alpha-007-localstorage
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
|
@@ -88,7 +88,7 @@ export default class SidebarSearch extends LightningElement {
|
|
|
88
88
|
private _coveoAdvancedQueryConfig!: { [key: string]: any };
|
|
89
89
|
private dropdownRequestedOpen: boolean = false;
|
|
90
90
|
private recentSearches: Option[] = [];
|
|
91
|
-
private unsubscribeFromResultList: Unsubscribe = () => {
|
|
91
|
+
private unsubscribeFromResultList: Unsubscribe = () => {};
|
|
92
92
|
private resultList: ResultList | null = null;
|
|
93
93
|
private resultsPerPage: ResultsPerPage | null = null;
|
|
94
94
|
private preloadedState?: SearchAppState;
|
|
@@ -247,7 +247,9 @@ export default class SidebarSearch extends LightningElement {
|
|
|
247
247
|
};
|
|
248
248
|
|
|
249
249
|
private syncAnalytics = () => {
|
|
250
|
-
const storedResult = window.localStorage.getItem(
|
|
250
|
+
const storedResult = window.localStorage.getItem(
|
|
251
|
+
RESULT_CLICK_LOCAL_STORAGE_KEY
|
|
252
|
+
);
|
|
251
253
|
if (storedResult) {
|
|
252
254
|
const interactiveResult = buildInteractiveResult(this.engine!, {
|
|
253
255
|
options: { result: JSON.parse(storedResult) }
|
|
@@ -256,7 +258,7 @@ export default class SidebarSearch extends LightningElement {
|
|
|
256
258
|
interactiveResult.select();
|
|
257
259
|
window.localStorage.removeItem(RESULT_CLICK_LOCAL_STORAGE_KEY);
|
|
258
260
|
}
|
|
259
|
-
}
|
|
261
|
+
};
|
|
260
262
|
|
|
261
263
|
private onResultListChange = () => {
|
|
262
264
|
if (!this.resultList) {
|
|
@@ -365,7 +367,10 @@ export default class SidebarSearch extends LightningElement {
|
|
|
365
367
|
href,
|
|
366
368
|
selected: isSelected,
|
|
367
369
|
select: () =>
|
|
368
|
-
window.localStorage.setItem(
|
|
370
|
+
window.localStorage.setItem(
|
|
371
|
+
RESULT_CLICK_LOCAL_STORAGE_KEY,
|
|
372
|
+
JSON.stringify(result)
|
|
373
|
+
)
|
|
369
374
|
};
|
|
370
375
|
};
|
|
371
376
|
|
|
@@ -406,10 +411,10 @@ export default class SidebarSearch extends LightningElement {
|
|
|
406
411
|
}
|
|
407
412
|
|
|
408
413
|
private updateRecentSearches = () =>
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
414
|
+
(this.recentSearches = UserRecentSearches.get().map((item: string) => ({
|
|
415
|
+
id: item,
|
|
416
|
+
label: item
|
|
417
|
+
})));
|
|
413
418
|
|
|
414
419
|
private dispatchSidebarSearchChange(searchTerm: string | undefined): void {
|
|
415
420
|
this.dispatchEvent(
|