Skip to content

Commit

Permalink
Add store.js to core assets
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Aug 25, 2024
1 parent b2815b5 commit 7562239
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions rdmo/core/assets/js/utils/store.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Cookies from 'js-cookie'
import isEmpty from 'lodash/isEmpty'

const checkStoreId = () => {
const currentStoreId = Cookies.get('storeid')
const localStoreId = localStorage.getItem('rdmo.storeid')

if (isEmpty(localStoreId) || localStoreId !== currentStoreId) {
localStorage.clear()
localStorage.setItem('rdmo.storeid', currentStoreId)
}
}

export { checkStoreId }

0 comments on commit 7562239

Please sign in to comment.