@sbaiahmed1/react-native-blur 4.1.1 → 4.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,14 +43,19 @@ class BlurEffectView: UIVisualEffectView {
43
43
  self?.effect = UIBlurEffect(style: self?.blurStyle ?? .systemMaterial)
44
44
  }
45
45
 
46
- // Set intensity and pause
46
+ // Set intensity
47
47
  animator?.fractionComplete = intensity
48
- animator?.pauseAnimation()
48
+ // Stop the animation at the current state
49
+ DispatchQueue.main.async { [weak self] in
50
+ self?.animator?.stopAnimation(true)
51
+ self?.animator?.finishAnimation(at: .current)
52
+ }
49
53
  }
50
54
 
51
55
  deinit {
52
- animator?.stopAnimation(true)
53
- animator?.finishAnimation(at: .current)
56
+ guard let animator = animator, animator.state == .active else { return }
57
+ animator.stopAnimation(true)
58
+ animator.finishAnimation(at: .current)
54
59
  }
55
60
  }
56
61
 
@@ -69,4 +74,4 @@ struct Blur: UIViewRepresentable {
69
74
  func updateUIView(_ uiView: BlurEffectView, context: Context) {
70
75
  uiView.updateBlur(style: style, intensity: intensity)
71
76
  }
72
- }
77
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sbaiahmed1/react-native-blur",
3
- "version": "4.1.1",
3
+ "version": "4.1.2",
4
4
  "description": "React native modern blur view",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",