|
@@ -129,13 +129,12 @@ public class Navigator extends ParentController {
|
129
|
129
|
public void push(final String fromId, final ViewController viewController, CommandListener listener) {
|
130
|
130
|
ViewController from = findControllerById(fromId);
|
131
|
131
|
if (from != null) {
|
132
|
|
- from.performOnParentStack(stack -> ((StackController) stack).push(viewController, listener));
|
|
132
|
+ from.performOnParentStack(
|
|
133
|
+ stack -> ((StackController) stack).push(viewController, listener),
|
|
134
|
+ () -> rejectPush(fromId, viewController, listener)
|
|
135
|
+ );
|
133
|
136
|
} else {
|
134
|
|
- listener.onError("Could not push component: " +
|
135
|
|
- viewController.getId() +
|
136
|
|
- ". Stack with id " +
|
137
|
|
- fromId +
|
138
|
|
- " was not found.");
|
|
137
|
+ rejectPush(fromId, viewController, listener);
|
139
|
138
|
}
|
140
|
139
|
}
|
141
|
140
|
|
|
@@ -204,4 +203,12 @@ public class Navigator extends ParentController {
|
204
|
203
|
ViewController controllerById = super.findControllerById(id);
|
205
|
204
|
return controllerById != null ? controllerById : modalStack.findControllerById(id);
|
206
|
205
|
}
|
|
206
|
+
|
|
207
|
+ private void rejectPush(String fromId, ViewController viewController, CommandListener listener) {
|
|
208
|
+ listener.onError("Could not push component: " +
|
|
209
|
+ viewController.getId() +
|
|
210
|
+ ". Stack with id " +
|
|
211
|
+ fromId +
|
|
212
|
+ " was not found.");
|
|
213
|
+ }
|
207
|
214
|
}
|