Closed jingrid closed 7 years ago
Try this?
module.exports = function (userId) {
if (store.user && (store.user.id === userId)) {
return '<button type="submit" class="remove-button" name="remove-button">Remove</button> <button type="submit" class="edit-button" name="edit-button">Edit</button>'
} else {
}
}
wow amazing. thx u
When trying to view all Pages before signing in, I'm getting the error:
jquery.js:3860 jQuery.Deferred exception: Cannot read property 'id' of undefined TypeError: Cannot read property 'id' of undefined
I think the issue lies in how I have handlebars set up to check for the ID of the user that's signed in, so obviously when user is not signed in, the ID will be undefined. How can I get around this?
I currently have handlebar as follows:
checkUser is a helper, as follows: