AnsweredAssumed Answered being fired twice

Question asked by efranklingis on Jun 7, 2017
Latest reply on Jun 15, 2017 by rscheitlin

I am attempting to display my own custom popup when a user clicks on the MapImageLayer with the following code:"visible", function(visible) {
                view.popup.visible = false;
                   var attr = view.popup.features[0].attributes;
                   var newPopup = formatPopup(attr);
                   $(newPopup).css({top: ($(window).height()/2)+'px',left: ($(window).width()/2)+'px'});

I try to close the default popup in the first line then second line I actually populate my own. I would like to stop this event from being fired twice with a single click, as a query is made twice which slows down the popup processing.