mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 12:40:08 +08:00
fa3a2ee631
Summary: Adding signature support in preferences Extracting out DraftStore extensions from the Contenteditable component Moved Contenteditable to the nylas component kit Build react remote window selection synchronization. Test Plan: todo Reviewers: bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D2204
14 lines
575 B
CoffeeScript
14 lines
575 B
CoffeeScript
{DraftStoreExtension, AccountStore} = require 'nylas-exports'
|
|
|
|
class SignatureDraftStoreExtension extends DraftStoreExtension
|
|
@prepareNewDraft: (draft) ->
|
|
accountId = AccountStore.current().id
|
|
signature = atom.config.get("nylas.account-#{accountId}.signature")
|
|
return unless signature
|
|
|
|
insertionPoint = draft.body.indexOf('<blockquote')
|
|
if insertionPoint is -1
|
|
insertionPoint = draft.body.length
|
|
draft.body = draft.body.substr(0, insertionPoint-1) + signature + draft.body.substr(insertionPoint)
|
|
|
|
module.exports = SignatureDraftStoreExtension
|