Skip to content

Commit 1c1968d

Browse files
authored
fix: Emit event on clearing local storage for comparison (#91)
Publish 'changedProductCompare' event with empty products array when clearing local storage.
1 parent 7678b80 commit 1c1968d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Resources/app/storefront/src/helper/compare-local-storage.helper.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class CompareLocalStorageHelper {
6565

6666
static clear() {
6767
window.localStorage.removeItem(this.key);
68+
69+
document.$emitter.publish('changedProductCompare', { products: [] });
6870
}
6971

7072
static _checkCompareProductStorage(products) {

0 commit comments

Comments
 (0)