0👍
I have solved this by adding if else statement inside the click event to check the isLoggedIn state value
const actions = {
preventClickingItems: ( {commit, state} ) => {
$('section').on('click', 'div.container *', (e) => {
if ( state.isLoggedIn ) {
return
}
else {
$('#modals-signup').modal('show')
e.preventDefault()
e.stopPropagation()
return false
}
})
}
}
Source:stackexchange.com