MOBILE-3914 menu: Fix more badge calculation
parent
3cfa76f7f7
commit
ee6263a006
|
@ -183,8 +183,13 @@ export class CoreMainMenuPage implements OnInit, OnDestroy {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const numItems = CoreMainMenu.getNumItems();
|
// Calculate the main handlers not to display them in this view.
|
||||||
this.moreBadge = this.allHandlers.some((handler, index) => (handler.onlyInMore || index >= numItems) && !!handler.badge);
|
const mainHandlers = this.allHandlers
|
||||||
|
.filter((handler) => !handler.onlyInMore)
|
||||||
|
.slice(0, CoreMainMenu.getNumItems());
|
||||||
|
|
||||||
|
// Use only the handlers that don't appear in the main view.
|
||||||
|
this.moreBadge = this.allHandlers.some((handler) => mainHandlers.indexOf(handler) == -1 && !!handler.badge);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue