[Refactor] Fix assignment of this to const (#631)

Refactors using arrows funcs or storing the once-off requirement as an
action, removing the need to dereference this inside the function.
This commit is contained in:
filtered
2025-02-27 21:32:53 +11:00
committed by GitHub
parent 2104f2a8a9
commit 0d8e0fce17
3 changed files with 46 additions and 46 deletions

View File

@@ -2762,10 +2762,10 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
img.src = LiteGraph.node_images_path + url
img.ready = false
const that = this
const dirty = () => this.setDirtyCanvas(true)
img.onload = function (this: AsyncImageElement) {
this.ready = true
that.setDirtyCanvas(true)
dirty()
}
return img
}