File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -31,14 +31,14 @@ Module.register("MMM-JsonTable", {
3131
3232 // Request node_helper to get json from url
3333 getJson ( ) {
34- this . sendSocketNotification ( "MMM-JsonTable_GET_JSON" , this . config . url ) ;
34+ this . sendSocketNotification ( "MMM-JsonTable_GET_JSON" , { url : this . config . url , id : this . identifier } ) ;
3535 } ,
3636
3737 socketNotificationReceived ( notification , payload ) {
3838 if ( notification === "MMM-JsonTable_JSON_RESULT" ) {
3939 // Only continue if the notification came from the request we made
4040 // This way we can load the module more than once
41- if ( payload . url === this . config . url ) {
41+ if ( payload . id === this . identifier ) {
4242 this . jsonData = payload . data ;
4343 this . updateDom ( this . config . animationSpeed ) ;
4444 }
Original file line number Diff line number Diff line change @@ -6,24 +6,24 @@ module.exports = NodeHelper.create({
66 Log . log ( "MMM-JsonTable helper started..." ) ;
77 } ,
88
9- getJson ( url ) {
9+ getJson ( payload ) {
1010 const self = this ;
1111
12- fetch ( url )
12+ fetch ( payload . url )
1313 . then ( ( response ) => response . json ( ) )
1414 . then ( ( json ) => {
1515 // Send the json data back with the url to distinguish it on the receiving part
1616 self . sendSocketNotification ( "MMM-JsonTable_JSON_RESULT" , {
17- url ,
17+ id : payload . id ,
1818 data : json
1919 } ) ;
2020 } ) ;
2121 } ,
2222
2323 // Subclass socketNotificationReceived received.
24- socketNotificationReceived ( notification , url ) {
24+ socketNotificationReceived ( notification , payload ) {
2525 if ( notification === "MMM-JsonTable_GET_JSON" ) {
26- this . getJson ( url ) ;
26+ this . getJson ( payload ) ;
2727 }
2828 }
2929} ) ;
You can’t perform that action at this time.
0 commit comments