Skip to content

Commit

Permalink
add Genie.findWebchannel()
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Jan 23, 2025
1 parent c4e41f8 commit 5eb3092
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions assets/js/channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@

// Genie.AllWebChannels holds all the channels created by the initWebChannel function
Genie.AllWebChannels = [];
Genie.findWebchannel = function(channel) {
return this.AllWebChannels.find((app) => app.channel == channel);
}
Genie.findApp = function(channel) {
const index = this.AllWebChannels.findIndex((app) => app.channel === channel);
return this.AllWebChannels[index].parent;
return this.AllWebChannels.find((app) => app.channel == channel).parent;
}
// Genie.WebChannels holds common handlers for all models
Genie.WebChannels = {};
Expand Down

0 comments on commit 5eb3092

Please sign in to comment.