mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Fixed "calling .set on destroyed object" error in gh-image-uploader tests
refs https://github.com/TryGhost/Admin/pull/2041 - the pretender upgrade highlighted an issue with the component's progress event handler where it could fire and attempt to set the progress property after the component has been destroyed
This commit is contained in:
parent
1bdb545ef7
commit
73a6354135
1 changed files with 3 additions and 1 deletions
|
@ -204,7 +204,9 @@ export default Component.extend({
|
|||
if (event.lengthComputable) {
|
||||
run(() => {
|
||||
let percentage = Math.round((event.loaded / event.total) * 100);
|
||||
this.set('uploadPercentage', percentage);
|
||||
if (!this.isDestroyed && !this.isDestroying) {
|
||||
this.set('uploadPercentage', percentage);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue