Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[23.0] Fix Webhooks not rendering #15985

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions client/src/utils/webhooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ const WebhookView = Backbone.View.extend({
},

render: function (model) {
const webhook = model.toJSON();
this.$el.html(`<div id="${webhook.id}"></div>`);
Utils.appendScriptStyle(webhook);
this.$el.html(`<div id="${model.id}"></div>`);
Utils.appendScriptStyle(model);
return this;
},
});
Expand Down Expand Up @@ -70,7 +69,7 @@ function filterType(data, type) {
}

function weightedRandomPick(data) {
const weights = data.pluck("weight");
const weights = data.map((d) => d.weight);
const sum = weights.reduce((a, b) => a + b);

const normalizedWeightsMap = new Map();
Expand Down