Skip to content

Commit c009f3c

Browse files
committed
Add store.js to core assets
1 parent 70f7a8a commit c009f3c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

rdmo/core/assets/js/utils/store.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Cookies from 'js-cookie'
2+
import isEmpty from 'lodash/isEmpty'
3+
4+
const checkStoreId = () => {
5+
const currentStoreId = Cookies.get('storeid')
6+
const localStoreId = localStorage.getItem('rdmo.storeid')
7+
8+
if (isEmpty(localStoreId) || localStoreId !== currentStoreId) {
9+
localStorage.clear()
10+
localStorage.setItem('rdmo.storeid', currentStoreId)
11+
}
12+
}
13+
14+
export { checkStoreId }

0 commit comments

Comments
 (0)