mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-16 21:58:39 -09:00
Fix component decoration in renderer (#2454)
* Fix decorateNotification * Fix typo * Fix plugin decoration in renderer
This commit is contained in:
parent
54cc70e656
commit
8ce71b9d88
2 changed files with 4 additions and 3 deletions
|
|
@ -5,7 +5,7 @@ import {decorate} from '../utils/plugins';
|
||||||
|
|
||||||
import Notification_ from './notification';
|
import Notification_ from './notification';
|
||||||
|
|
||||||
const Notification = decorate(Notification_);
|
const Notification = decorate(Notification_, 'Notification');
|
||||||
|
|
||||||
export default class Notifications extends PureComponent {
|
export default class Notifications extends PureComponent {
|
||||||
template(css) {
|
template(css) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import {remote} from 'electron';
|
import {remote} from 'electron';
|
||||||
import {connect as reduxConnect} from 'react-redux';
|
import {connect as reduxConnect} from 'react-redux';
|
||||||
|
import {basename} from 'path';
|
||||||
|
|
||||||
// patching Module._load
|
// patching Module._load
|
||||||
// so plugins can `require` them without needing their own version
|
// so plugins can `require` them without needing their own version
|
||||||
|
|
@ -126,7 +127,7 @@ const loadModules = () => {
|
||||||
const loadedPlugins = plugins.getLoadedPluginVersions().map(plugin => plugin.name);
|
const loadedPlugins = plugins.getLoadedPluginVersions().map(plugin => plugin.name);
|
||||||
modules = paths.plugins
|
modules = paths.plugins
|
||||||
.concat(paths.localPlugins)
|
.concat(paths.localPlugins)
|
||||||
.filter(plugin => loadedPlugins.indexOf(plugin) !== -1)
|
.filter(plugin => loadedPlugins.indexOf(basename(plugin)) !== -1)
|
||||||
.map(path => {
|
.map(path => {
|
||||||
let mod;
|
let mod;
|
||||||
const pluginName = getPluginName(path);
|
const pluginName = getPluginName(path);
|
||||||
|
|
@ -496,7 +497,7 @@ export function decorate(Component_, name) {
|
||||||
return class DecoratedComponent extends React.Component {
|
return class DecoratedComponent extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {has_error: false};
|
this.state = {hasError: false};
|
||||||
}
|
}
|
||||||
componentDidCatch() {
|
componentDidCatch() {
|
||||||
this.setState({hasError: true});
|
this.setState({hasError: true});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue