Fix component decoration in renderer (#2454)

* Fix decorateNotification

* Fix typo

* Fix plugin decoration in renderer
This commit is contained in:
CHaBou 2017-11-13 16:02:49 +01:00 committed by GitHub
parent 54cc70e656
commit 8ce71b9d88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -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) {

View file

@ -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});