Skip to content

Commit

Permalink
[4.x] fixed frontend request polling memory leaks (#1086)
Browse files Browse the repository at this point in the history
* fixed frontend request polling memory leaks
- fix #1085

* Update IndexScreen.vue

* Update IndexScreen.vue

Co-authored-by: Taylor Otwell <taylor@laravel.com>
  • Loading branch information
myckhel and taylorotwell authored Jul 6, 2021
1 parent 77373b6 commit e39ab3b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion public/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"/app.js": "/app.js?id=c48415fc82fa39a8e52f",
"/app.js": "/app.js?id=a8705a256daefb4ab161",
"/app-dark.css": "/app-dark.css?id=6906f1f2fc2f23cf8a99",
"/app.css": "/app.css?id=16d2a66165bdfcf0ad02"
}
18 changes: 10 additions & 8 deletions resources/js/components/IndexScreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,20 @@
'&take=1' +
'&family_hash=' + this.familyHash
).then(response => {
this.recordingStatus = response.data.status;
if (! this._isDestroyed) {
this.recordingStatus = response.data.status;
if (response.data.entries.length && !this.entries.length) {
this.loadNewEntries();
} else if (response.data.entries.length && _.first(response.data.entries).id !== _.first(this.entries).id) {
if (this.$root.autoLoadsNewEntries) {
if (response.data.entries.length && !this.entries.length) {
this.loadNewEntries();
} else if (response.data.entries.length && _.first(response.data.entries).id !== _.first(this.entries).id) {
if (this.$root.autoLoadsNewEntries) {
this.loadNewEntries();
} else {
this.hasNewEntries = true;
}
} else {
this.hasNewEntries = true;
this.checkForNewEntries();
}
} else {
this.checkForNewEntries();
}
})
}, this.newEntriesTimer);
Expand Down

0 comments on commit e39ab3b

Please sign in to comment.