fixes 2065: optimisation (#2073)
authorJohn Livingston <38844060+JohnXLivingston@users.noreply.github.com>
Fri, 23 Aug 2019 07:05:30 +0000 (09:05 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 23 Aug 2019 07:05:30 +0000 (09:05 +0200)
* fixes 2065: optimisation

* Update peertube-socket.ts

server/lib/peertube-socket.ts

index ad2bb4845d45319feae5993ed5bec8a4a5dfbdc5..26ced351f3333cf1dfe756dc333ad95653c9ff88 100644 (file)
@@ -39,8 +39,9 @@ class PeerTubeSocket {
 
     if (!sockets) return
 
+    const notificationMessage = notification.toFormattedJSON()
     for (const socket of sockets) {
-      socket.emit('new-notification', notification.toFormattedJSON())
+      socket.emit('new-notification', notificationMessage)
     }
   }