|
@@ -20,7 +20,8 @@ async function startSingleScreenApp(params) {
|
20
|
20
|
if (components) {
|
21
|
21
|
params.screen = createSingleScreen(components[0]);
|
22
|
22
|
components.shift();
|
23
|
|
- params.screen.screens = components.map(createSingleScreen);
|
|
23
|
+ params.screen.screens = components.map(createSingleScreen) || [];
|
|
24
|
+ params.screen.screens.map((c, i) => i === 0 ? c : addTitleBarBackButtonIfNeeded(c));
|
24
|
25
|
} else {
|
25
|
26
|
params.screen = createSingleScreen({...params.screen, passProps: params.passProps});
|
26
|
27
|
}
|
|
@@ -314,10 +315,12 @@ async function startTabBasedApp(params) {
|
314
|
315
|
params.tabs.forEach(function(tab, idx) {
|
315
|
316
|
if (tab.components) {
|
316
|
317
|
const components = tab.components;
|
317
|
|
- const screen = createBottomTabScreen(components[0], idx, params)
|
318
|
|
- const {label, icon} = components[0];
|
319
|
|
- components.shift();
|
|
318
|
+ const screen = createBottomTabScreen(tab, idx, params)
|
|
319
|
+ const {label, icon} = screen;
|
320
|
320
|
screen.screens = components.map(c => createBottomTabScreen({...c, icon, label}, idx, params));
|
|
321
|
+ screen.screens.map((s, i) => addTitleBarBackButtonIfNeeded(s));
|
|
322
|
+ screen.screens.map((s, i) => s.navigationParams.navigatorID = screen.navigationParams.navigatorID);
|
|
323
|
+ screen = _.omit(screen, ['components']);
|
321
|
324
|
newTabs.push(screen);
|
322
|
325
|
} else {
|
323
|
326
|
newTabs.push(createBottomTabScreen(tab, idx, params));
|