From ac632a69d2c0219fe348f8dbaaf9ab9707a85eed Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Wed, 12 Apr 2017 09:40:18 -0300 Subject: [PATCH] unregister hooks names --- client/coral-plugin-commentbox/CommentBox.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/coral-plugin-commentbox/CommentBox.js b/client/coral-plugin-commentbox/CommentBox.js index e8c257899..56c5f03b5 100644 --- a/client/coral-plugin-commentbox/CommentBox.js +++ b/client/coral-plugin-commentbox/CommentBox.js @@ -110,17 +110,17 @@ class CommentBox extends Component { return this.state.hooks; } - unregisterHook = (hookType = '', hook = '') => { + unregisterHook = (hookType = '', hookName = '') => { const hooks = this.state.hooks; if (hooks[hookType]) { - if (hooks[hookType][hook]) { - delete hooks[hookType][hook]; + if (hooks[hookType][hookName]) { + delete hooks[hookType][hookName]; } else { - console.warn(`${hook} is invalid. Cannot unregister ${hook} Hook `); + console.warn(`${hookName} is invalid. Cannot unregister ${hookName} Hook `); } } else { - console.warn(`${hookType} does not exist. Cannot unregister ${hook} Hook `); + console.warn(`${hookType} does not exist. Cannot unregister ${hookName} Hook `); } this.setState(() => ({hooks}));