Closed casebenton closed 8 years ago
The issue number in the commit message is wrong.
Assuming you meant #66, this is an okay solution, but there's something you can use that is better; panel events.
The panel docs mention events that you can subscribe to using the on method. Instead of adding more state to track whether the panel has been shown or not, you should instead remove the tracking of panel shows from the button click handler, and instead register a listener for when the panel is shown and log to telemetry there. Then you have less state to track and can be confident that panel shows are logged in all situations.
What do you think?
I agree that this is a better solution. It felt risky to have to keep track of state that the sdk/panel was certainly also storing. I'm doing a variation of this already for hide events. In the panel constructor method, one of the properties of the object passed to the constructor specifies my method to call on panel hide events. I'll use this technique for the show event too for symmetry.
@Osmose I'm using the sdk/panel's event listener for panel open events now. r?
Much better. This looks great, just rebase the two commits into a single commit please, and I'm r+ on this. Nice work!
@Osmose r?