I am running into the following error when the user clicks on the Power-Up button and I try to display a popup:
The issue seems to arise because I am trying to call a popup after I get the id of the board in scope using t.board
. The same thing was happening for this person (but I don’t think they ever raised the issue here so it never got investigated).
Here is the full relevant code. It is the callback inside of the “card-buttons” property of Trello.initialize:
...
callback: context => {
t.board("id").then(({ id }) => {
if (checkIfCorrectBoard(id)) {
context.popup({
title: "My Custom Power-Up",
items: [
{
text: "Edit Power-Up Settings",
callback: function() {}
},
{
text: "Manage Subscription",
callback: function() {
return t.modal({
url: "./subscribe.html"
});
}
}
]
});
} else {
context.popup({
title: 'My Custom Power-Up',
url: './auth.html',
height: 200
})
}
})
Thank you in advance for any light you can shed on this!