File tree Expand file tree Collapse file tree 3 files changed +7
-14
lines changed Expand file tree Collapse file tree 3 files changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -494,7 +494,6 @@ - (void)runActionNamed:(NSString *)name
494494 childContext->_key = name;
495495 dispatch_async (dispatch_get_main_queue (), ^{
496496 [[LPActionManager shared ] triggerWithContexts: @[childContext] priority: PriorityHigh trigger: nil ];
497-
498497 });
499498 }
500499
Original file line number Diff line number Diff line change @@ -10,15 +10,8 @@ import Foundation
1010extension ActionManager {
1111 final class Queue {
1212 let lock = DispatchQueue ( label: " leanplum.access_dispatch_queue " , attributes: . concurrent)
13- var didChange : ( ( ) -> Void ) ?
14- var queue : [ Action ] = [ ] {
15- didSet {
16- DispatchQueue . main. async {
17- self . didChange ? ( )
18- }
19- }
20- }
21-
13+ var queue : [ Action ] = [ ]
14+
2215 func pushBack( _ item: Action ) {
2316 lock. async ( flags: . barrier) {
2417 self . queue. append ( item)
Original file line number Diff line number Diff line change @@ -46,9 +46,6 @@ import Foundation
4646
4747 override init ( ) {
4848 super. init ( )
49- queue. didChange = {
50- self . performAvailableActions ( )
51- }
5249 scheduler. actionDelayed = {
5350 self . appendActions ( actions: [ $0] )
5451 }
@@ -113,7 +110,9 @@ import Foundation
113110 func performAvailableActions( ) {
114111 Log . debug ( " [ActionManager]: performing all available actions. " )
115112 Leanplum . onceVariablesChangedAndNoDownloadsPending {
116- self . performActions ( )
113+ DispatchQueue . main. async {
114+ self . performActions ( )
115+ }
117116 }
118117 }
119118}
@@ -123,6 +122,7 @@ extension ActionManager {
123122 func appendActions( actions: [ Action ] ) {
124123 guard isEnabled else { return }
125124 actions. forEach ( queue. pushBack ( _: ) )
125+ performAvailableActions ( )
126126 }
127127
128128 /// Adds action to front of the queue
@@ -131,5 +131,6 @@ extension ActionManager {
131131 actions
132132 . reversed ( )
133133 . forEach ( queue. pushFront ( _: ) )
134+ performAvailableActions ( )
134135 }
135136}
You can’t perform that action at this time.
0 commit comments