mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-23 15:46:28 +08:00
fix(analytics): Add pgp encryption events
Email Encrypted Email Encryption Errored Email Decrypted Email Decryption Errored
This commit is contained in:
parent
1c675935a7
commit
a23931454d
2 changed files with 4 additions and 0 deletions
|
@ -106,8 +106,10 @@ class EncryptMessageButton extends React.Component
|
|||
@_checkKeysAndEncrypt(plaintext, identities, (err, cryptotext) =>
|
||||
if err
|
||||
console.warn err
|
||||
Actions.recordUserEvent("Email Encryption Errored", {error: err})
|
||||
NylasEnv.showErrorDialog(err)
|
||||
if cryptotext? and cryptotext != ""
|
||||
Actions.recordUserEvent("Email Encrypted")
|
||||
# <pre> tag prevents gross HTML formatting in-flight
|
||||
cryptotext = "<pre>#{cryptotext}</pre>"
|
||||
@setState({
|
||||
|
|
|
@ -415,6 +415,7 @@ class PGPKeyStore extends NylasStore
|
|||
errMsg = "Unable to decrypt message. Private key does not match encrypted block."
|
||||
if !@msgStatus(message)?
|
||||
errMsg = "Decryption preprocessing failed."
|
||||
Actions.recordUserEvent("Email Decryption Errored", {error: errMsg})
|
||||
@_msgStatus.push({"clientId": message.clientId, "time": Date.now(), "message": errMsg})
|
||||
else
|
||||
if warnings._w.length > 0
|
||||
|
@ -436,6 +437,7 @@ class PGPKeyStore extends NylasStore
|
|||
keyprint = subkey.get_fingerprint().toString('hex')
|
||||
@_msgStatus.push({"clientId": message.clientId, "time": Date.now(), "message": "Message decrypted with key #{keyprint}"})
|
||||
# re-render messages
|
||||
Actions.recordUserEvent("Email Decrypted")
|
||||
MessageBodyProcessor.resetCache()
|
||||
@trigger(@)
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue