From 067a12dc17a06f8c6fde3ea9d8038d92bb9b3d96 Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Wed, 30 Dec 2015 19:05:27 -0500 Subject: [PATCH] fix(extensions):Fix extension method calls that weren't passing args hash --- .../lib/availability-composer-extension.coffee | 2 +- src/extensions/composer-extension.coffee | 2 +- src/flux/stores/draft-store.coffee | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/N1-Quick-Schedule/lib/availability-composer-extension.coffee b/examples/N1-Quick-Schedule/lib/availability-composer-extension.coffee index c26355295..c77e3f637 100644 --- a/examples/N1-Quick-Schedule/lib/availability-composer-extension.coffee +++ b/examples/N1-Quick-Schedule/lib/availability-composer-extension.coffee @@ -7,7 +7,7 @@ class AvailabilityComposerExtension extends ComposerExtension # When subclassing the ComposerExtension, you can add your own custom logic # to execute before a draft is sent in the @finalizeSessionBeforeSending # method. Here, we're registering the events before we send the draft. - @finalizeSessionBeforeSending: (session) -> + @finalizeSessionBeforeSending: ({session}) -> body = session.draft().body participants = session.draft().participants() sender = session.draft().from diff --git a/src/extensions/composer-extension.coffee b/src/extensions/composer-extension.coffee index 7a7c8b30c..3ce365b60 100644 --- a/src/extensions/composer-extension.coffee +++ b/src/extensions/composer-extension.coffee @@ -112,7 +112,7 @@ class ComposerExtension extends ContenteditableExtension session.changes.add(body: clean) ``` ### - @finalizeSessionBeforeSending: (session) -> + @finalizeSessionBeforeSending: ({session}) -> return Promise.resolve(session) module.exports = ComposerExtension diff --git a/src/flux/stores/draft-store.coffee b/src/flux/stores/draft-store.coffee index 19e13636c..d01b4fc65 100644 --- a/src/flux/stores/draft-store.coffee +++ b/src/flux/stores/draft-store.coffee @@ -532,7 +532,7 @@ class DraftStore # Give third-party plugins an opportunity to sanitize draft data _runExtensionsBeforeSend: (session) => Promise.each @extensions(), (ext) -> - ext.finalizeSessionBeforeSending(session) + ext.finalizeSessionBeforeSending({session}) .return(session) _onRemoveFile: ({file, messageClientId}) =>