@salesforcedevs/dx-components 1.3.92-alpha-005-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) {
|
|
@@ -364,12 +366,11 @@ export default class SidebarSearch extends LightningElement {
|
|
|
364
366
|
uniqueId,
|
|
365
367
|
href,
|
|
366
368
|
selected: isSelected,
|
|
367
|
-
select: () =>
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
},
|
|
369
|
+
select: () =>
|
|
370
|
+
window.localStorage.setItem(
|
|
371
|
+
RESULT_CLICK_LOCAL_STORAGE_KEY,
|
|
372
|
+
JSON.stringify(result)
|
|
373
|
+
)
|
|
373
374
|
};
|
|
374
375
|
};
|
|
375
376
|
|
|
@@ -410,10 +411,10 @@ export default class SidebarSearch extends LightningElement {
|
|
|
410
411
|
}
|
|
411
412
|
|
|
412
413
|
private updateRecentSearches = () =>
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
414
|
+
(this.recentSearches = UserRecentSearches.get().map((item: string) => ({
|
|
415
|
+
id: item,
|
|
416
|
+
label: item
|
|
417
|
+
})));
|
|
417
418
|
|
|
418
419
|
private dispatchSidebarSearchChange(searchTerm: string | undefined): void {
|
|
419
420
|
this.dispatchEvent(
|