mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-21 10:16:32 +00:00
feat: log the event status of the banner (#2013)
We add log the banner HTTP load event object to the analytics. Change-Type: patch Changelog-Entry: Log the banner load event to analytics.
This commit is contained in:
parent
de4f9e4257
commit
34b4f65c20
@ -190,13 +190,18 @@ class SafeWebview extends react.PureComponent {
|
|||||||
* @param {Event} event - Event object
|
* @param {Event} event - Event object
|
||||||
*/
|
*/
|
||||||
didGetResponseDetails (event) {
|
didGetResponseDetails (event) {
|
||||||
|
// This seems to pick up all requests related to the webview,
|
||||||
|
// only care about this event if it's a request for the main frame
|
||||||
|
if (event.resourceType === 'mainFrame') {
|
||||||
const HTTP_OK = 200
|
const HTTP_OK = 200
|
||||||
const HTTP_ERR = 400
|
|
||||||
|
analytics.logEvent(event)
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
shouldShow: event.httpResponseCode >= HTTP_OK && event.httpResponseCode < HTTP_ERR
|
shouldShow: event.httpResponseCode === HTTP_OK
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @summary Open link in browser if it's opened as a 'foreground-tab'
|
* @summary Open link in browser if it's opened as a 'foreground-tab'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user