Explorar o código

Fix a log streaming memory leak

Fixes a memory leak caused by not reinitialising the JS array object
when adding new lines to the stream after the stream maximum lines have
been reached.
Sergiu Miclea %!s(int64=6) %!d(string=hai) anos
pai
achega
eb2b3f4e88
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/stores/LogStore.js

+ 1 - 1
src/stores/LogStore.js

@@ -99,7 +99,7 @@ class LogStore {
   @action addToLiveFeed(feed: { message: string }) {
     this.liveFeed = [...this.liveFeed, feed.message]
     if (this.liveFeed.length > MAX_STREAM_LINES) {
-      this.liveFeed = this.liveFeed.filter((f, i) => i > this.liveFeed.length - MAX_STREAM_LINES)
+      this.liveFeed = [...this.liveFeed.filter((f, i) => i > this.liveFeed.length - MAX_STREAM_LINES)]
     }
   }