Browse Source

Emit ModalDismissed event before resolving dismissModal promise

Guy Carmeli 6 years ago
parent
commit
fd483a00ea

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/modal/ModalStack.java View File

@@ -58,8 +58,8 @@ public class ModalStack {
58 58
             CommandListenerAdapter onDismiss = new CommandListenerAdapter(listener) {
59 59
                 @Override
60 60
                 public void onSuccess(String childId) {
61
-                    super.onSuccess(childId);
62 61
                     eventEmitter.emitModalDismissed(toDismiss.getId(), 1);
62
+                    super.onSuccess(childId);
63 63
                 }
64 64
             };
65 65
             if (isTop) {
@@ -86,8 +86,8 @@ public class ModalStack {
86 86
                 dismissModal(modals.get(0).getId(), root, new CommandListenerAdapter(listener) {
87 87
                     @Override
88 88
                     public void onSuccess(String childId) {
89
-                        super.onSuccess(childId);
90 89
                         eventEmitter.emitModalDismissed(topModalId, modalsDismissed);
90
+                        super.onSuccess(childId);
91 91
                     }
92 92
                 });
93 93
             } else {