Skip to content

Commit efc78f6

Browse files
tsantefpushmatrix
authored andcommitted
Prevents duplicate widget event notifications
1 parent b32636b commit efc78f6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

javascripts/dashing.coffee

+7-6
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,13 @@ source.addEventListener 'error', (e)->
100100

101101
source.addEventListener 'message', (e) =>
102102
data = JSON.parse(e.data)
103-
if Dashing.debugMode
104-
console.log("Received data for #{data.id}", data)
105-
lastEvents[data.id] = data
106-
if widgets[data.id]?.length > 0
107-
for widget in widgets[data.id]
108-
widget.receiveData(data)
103+
if lastEvents[data.id]?.updatedAt != data.updatedAt
104+
if Dashing.debugMode
105+
console.log("Received data for #{data.id}", data)
106+
lastEvents[data.id] = data
107+
if widgets[data.id]?.length > 0
108+
for widget in widgets[data.id]
109+
widget.receiveData(data)
109110

110111

111112
$(document).ready ->

0 commit comments

Comments
 (0)