Skip to content

Commit

Permalink
Properly filter relevant tracks in a connection
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettjstevens committed Nov 10, 2020
1 parent ee3d90c commit 4e2e1fa
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,18 @@ export default pluginManager =>
const trackConfigurations = connection.tracks

const relevantTrackConfigurations = trackConfigurations.filter(
conf => conf.viewType === self.view.type,
trackConf => {
const viewType = pluginManager.getViewType(self.view.type)
const compatibleDisplays = viewType.displayTypes.map(
displayType => displayType.name,
)
for (const display of trackConf.displays) {
if (compatibleDisplays.includes(display.type)) {
return true
}
}
return false
},
)
return relevantTrackConfigurations
},
Expand Down

0 comments on commit 4e2e1fa

Please sign in to comment.