mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-20 22:23:53 +08:00
feat(message-controls): Option to copy message IDs/metadata to clipboard
This commit is contained in:
parent
26b8f22a31
commit
0e522ec789
1 changed files with 10 additions and 0 deletions
|
@ -84,6 +84,7 @@ class MessageControls extends React.Component
|
|||
menu.append(new SystemMenuItem({ label: 'Report Issue: Rendering', click: => @_onReport('Rendering')}))
|
||||
menu.append(new SystemMenuItem({ type: 'separator'}))
|
||||
menu.append(new SystemMenuItem({ label: 'Show Original', click: => @_onShowOriginal()}))
|
||||
menu.append(new SystemMenuItem({ label: 'Copy Debug Info to Clipboard', click: => @_onCopyToClipboard()}))
|
||||
menu.append(new SystemMenuItem({ label: 'Log Data', click: => @_onLogData()}))
|
||||
menu.popup(remote.getCurrentWindow())
|
||||
|
||||
|
@ -136,4 +137,13 @@ class MessageControls extends React.Component
|
|||
window.__thread = @props.thread
|
||||
console.log "Also now available in window.__message and window.__thread"
|
||||
|
||||
_onCopyToClipboard: =>
|
||||
clipboard = require('electron').clipboard
|
||||
data = "Message ID: #{@props.message.serverId}\n"+
|
||||
"Message Metadata: #{JSON.stringify(@props.message.pluginMetadata, null, ' ')}\n"+
|
||||
"Thread ID: #{@props.thread.serverId}\n"+
|
||||
"Thread Metadata: #{JSON.stringify(@props.thread.pluginMetadata, null, ' ')}\n"
|
||||
|
||||
clipboard.writeText(data)
|
||||
|
||||
module.exports = MessageControls
|
||||
|
|
Loading…
Reference in a new issue