From 8ce71b9d88afd6c5900531c03157e4c1ebaff903 Mon Sep 17 00:00:00 2001 From: CHaBou Date: Mon, 13 Nov 2017 16:02:49 +0100 Subject: [PATCH] Fix component decoration in renderer (#2454) * Fix decorateNotification * Fix typo * Fix plugin decoration in renderer --- lib/components/notifications.js | 2 +- lib/utils/plugins.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/components/notifications.js b/lib/components/notifications.js index 50f3d4cf..c9189721 100644 --- a/lib/components/notifications.js +++ b/lib/components/notifications.js @@ -5,7 +5,7 @@ import {decorate} from '../utils/plugins'; import Notification_ from './notification'; -const Notification = decorate(Notification_); +const Notification = decorate(Notification_, 'Notification'); export default class Notifications extends PureComponent { template(css) { diff --git a/lib/utils/plugins.js b/lib/utils/plugins.js index 0299574b..635ee0f3 100644 --- a/lib/utils/plugins.js +++ b/lib/utils/plugins.js @@ -1,5 +1,6 @@ import {remote} from 'electron'; import {connect as reduxConnect} from 'react-redux'; +import {basename} from 'path'; // patching Module._load // so plugins can `require` them without needing their own version @@ -126,7 +127,7 @@ const loadModules = () => { const loadedPlugins = plugins.getLoadedPluginVersions().map(plugin => plugin.name); modules = paths.plugins .concat(paths.localPlugins) - .filter(plugin => loadedPlugins.indexOf(plugin) !== -1) + .filter(plugin => loadedPlugins.indexOf(basename(plugin)) !== -1) .map(path => { let mod; const pluginName = getPluginName(path); @@ -496,7 +497,7 @@ export function decorate(Component_, name) { return class DecoratedComponent extends React.Component { constructor(props) { super(props); - this.state = {has_error: false}; + this.state = {hasError: false}; } componentDidCatch() { this.setState({hasError: true});