Read the statement by Michael Teeuw here.
SocketNotification not working?
-
This post is deleted! -
@tjat said in SocketNotification not working?:
this.sendSocketNotification
what does the ‘this’ point to ? to module helper instance or something else?
-
@sdetweil - It’s within the main module we’re I’m creating the calendar event. I’m following the same syntax being used above, which is working. I’ll also caveat that I’m not really experienced with this stuff so likely am doing something dumb. Am I losing the “this” reference somehow? Appreciate the help
this.sendSocketNotification("ADD_CALENDAR_EVENT", payload); this.message = "Adding event..."; this.messageType = "info"; this.updateDom(); this.closeForm(); }, notificationReceived: function(notification, payload, sender) { // TODO: Handle notifications }, socketNotificationReceived: function(notification, payload) { if (notification === "EVENT_ADD_SUCCESS_MAIN") { console.log ("Sending event to calendar"); this.showMessage('Event added!', 'success'); if (payload) { this.sendNotification("EVENT_ADD_SUCCESS", payload); } else { this.sendNotification("EVENT_ADD_SUCCESS"); } } else if (notification === 'EVENT_ADD_FAILED') { this.showMessage('Event not added', 'error'); if (payload) { this.sendNotification("EVENT_ADD_FAILED", payload); } else { this.sendNotification("EVENT_ADD_FAILED"); } } }, -
@tjat
Could you share the whole code in Git Hub? -
@tjat
If your calendar object is defined in anamedfunction,thiswill indicate the function itself. However in that case,sendSocketNotificationwould cause an undefined function error.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login