]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/peertube-socket.ts
fixes 2065: optimisation (#2073)
[github/Chocobozzz/PeerTube.git] / 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)
     }
   }