Conversation
dwosk
left a comment
There was a problem hiding this comment.
@JAHMCR did you see my comment on the ticket about adding the listener for isKeepAlive?
It should be a relatively minor change (i.e. don't think we need to export any new functions, etc.)
// Register in Safari context
document.addEventListener('isAppAlive', (event) => {
console.info('Desktop app running', event.detail.running);
});When the SDK gets an event, it should have logic to trigger the registered status listeners (i.e. listeners registered via registerStatusCallback) if the desktop app went from running -> not running or vice versa.
Yeah thanks, I will update the PR very soon |
3e1aaae to
a986a44
Compare
dabrad26
left a comment
There was a problem hiding this comment.
Maybe can change to !item for all the item === undefined stuff. Do we have a type for the any on events. Maybe better if we can define event
| */ | ||
| private listenResponseEvents() { | ||
| document.addEventListener('AsperaDesktop.Response', (event: CustomEvent<JSONRPCResponse>) => { | ||
| if (event.detail === undefined) { |
There was a problem hiding this comment.
We can probably just do !event.detail. Then we don’t need to explicit checking undefined as I assume we don’t want continue if null or empty string or anything.
Added a listener to handle when the client state changes to notify event subscribers accordingly.