Skip to content

Commit

Permalink
fix: cancel request when off screen (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
duguyihou authored May 10, 2024
1 parent de6a490 commit d06b1bd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ios/TurboImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ final class TurboImageView : UIView {
lazyImageView.processors = processors
}

override func didMoveToWindow() {
super.didMoveToWindow()
if window == nil {
lazyImageView.cancel()
}
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
Expand Down

0 comments on commit d06b1bd

Please sign in to comment.