Fix for pluginpanel crashing
This commit is contained in:
parent
eff75f27dc
commit
91dd2e6ee7
|
@ -3863,7 +3863,9 @@ class V2C_PluginCard extends BDV2.reactComponent {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
let self = this;
|
let self = this;
|
||||||
self.settingsPanel = self.props.plugin.getSettingsPanel();
|
if (typeof self.props.plugin.getSettingsPanel === "function") {
|
||||||
|
self.settingsPanel = self.props.plugin.getSettingsPanel();
|
||||||
|
}
|
||||||
self.onChange = self.onChange.bind(self);
|
self.onChange = self.onChange.bind(self);
|
||||||
self.showSettings = self.showSettings.bind(self);
|
self.showSettings = self.showSettings.bind(self);
|
||||||
self.setInitialState();
|
self.setInitialState();
|
||||||
|
@ -3943,7 +3945,7 @@ class V2C_PluginCard extends BDV2.reactComponent {
|
||||||
BDV2.react.createElement("input", { checked: this.state.checked, onChange: this.onChange, className: "ui-switch-checkbox", type: "checkbox" }),
|
BDV2.react.createElement("input", { checked: this.state.checked, onChange: this.onChange, className: "ui-switch-checkbox", type: "checkbox" }),
|
||||||
BDV2.react.createElement("div", { className: "ui-switch" })
|
BDV2.react.createElement("div", { className: "ui-switch" })
|
||||||
),
|
),
|
||||||
BDV2.react.createElement(
|
this.settingsPanel && BDV2.react.createElement(
|
||||||
"button",
|
"button",
|
||||||
{ onClick: this.showSettings },
|
{ onClick: this.showSettings },
|
||||||
"Settings"
|
"Settings"
|
||||||
|
@ -3966,6 +3968,7 @@ class V2C_PluginCard extends BDV2.reactComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
showSettings() {
|
showSettings() {
|
||||||
|
if (!this.settingsPanel) return;
|
||||||
this.setState({
|
this.setState({
|
||||||
'settings': true
|
'settings': true
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue