Forum Discussion
sunnykalola
Aug 12, 2020Brass Contributor
While Removing conenctor in MSTeams, "registerOnRemoveHandler" method is called twice.
I am trying to remove a connector from MSTeams, i have noticed that "registerOnRemoveHandler" method is executing twice, and in this method i have written AJAX calls for removing dependencies...
sunnykalola
Aug 14, 2020Brass Contributor
Thank You Nikitha-MSFT . I haven't write 2 instance for the method. Also i have referred a link which you had shared there is one variable "removeCalled" which value is set as true and below that i have implement my AJAX call.but then also it's called twice.
below is a sample code :
microsoftTeams.settings.registerOnRemoveHandler(function (removeEvent) {
var removeCalled = true;
// AJAX Call
$.ajax({
url: "https://example.com",
type: "DELETE",
data: "string",
contentType: "application/json",
success: function () {
removeEvent.notifySuccess();
},
error: function () {
removeEvent.notifyFailure("Failed");
}
});
})
Nikitha-MSFT
Aug 19, 2020Former Employee
sunnykalola - Could you please try the code mentioned in sample?