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 Nov 14, 2024
1 parent 70f7a8a commit c009f3c
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 c009f3c

Please sign in to comment.