Skip to content

Commit

Permalink
Ensure _customRouteId is available
Browse files Browse the repository at this point in the history
  • Loading branch information
swashbuck committed Jun 25, 2024
1 parent 6f4f1a4 commit 530746b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/PageNavModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class PageNavModel extends ComponentModel {
// Get models, skipping any undefined types (ex. deprecated button types)
// Find buttonModel from config._customRouteId if not found in defined type
const buttonModel = buttonConfig._customRouteId
? data.findById(buttonConfig._customRouteId)
? this.getCustomRoutePage(buttonConfig._customRouteId)
: buttonTypeModels[type];

if (!buttonModel) continue;
Expand Down Expand Up @@ -140,6 +140,12 @@ class PageNavModel extends ComponentModel {
}
}

getCustomRoutePage(id) {
const buttonModel = data.findById(id);
if (!buttonModel || !buttonModel.get('_isAvailable')) return;
return buttonModel;
}

getPages() {
const loopStyle = this.get('_loopStyle');
let descendants = (loopStyle === 'allPages')
Expand Down

0 comments on commit 530746b

Please sign in to comment.