Read the statement by Michael Teeuw here.
Calendar: Cannot user ADD_CALENDAR socket notification to add a new calendar
-
Hello,
I would like to send a notification via a node_helper of another module, so that the intefarce included a new calendar. But when I execute this code, nothing happens.
I tried to debug the calendar node_helper, and I see that the sole notification that arrives is FETCH_CALENDAR.this.io.of("calendar").emit("ADD_CALENDAR",payload);
Could you suggest what’s going on?
-
@SimoneMSR
lots of issues
the socket connection is only to your module, module y helper cannot interact with helper from module zadd_calendar starts a data collector(fetcher) to inform the ui to use later
but the controlling data is in the module, not in the helper. helper asynchronously sends back events for the url, calendar module uses url to find config for display, but it doesnt match any, so the data is tossed
so you would have to extend calendar.js to accept an add_calender notification (not socket) to add another configuration, and trigger the add_calendar socket notification to its helper
then YOUR helper would send YOUR module a socket notification to request IT to send the (not socket) notification to inform the calendar module
note that sendNotification is a broadcast to all broswer side modules
-
@sdetweil Thank you for the useful hints! I will soon work on them, and consider making a pull request to the community.