zerebos / BDPluginLibrary

Plugin library for BetterDiscord.
MIT License
213 stars 139 forks source link

Problem with Settings.Switch in 0PluginLibrary.plugin.js/ZLibrary.js #42

Closed Japanese-Schoolgirl closed 3 years ago

Japanese-Schoolgirl commented 3 years ago

Hi. Recently I started to have a problem with Settings.Switch in 0PluginLibrary/ZLibrary (tested both).

When trying to run code:

var { Settings } = ZeresPluginLibrary;
var test = document.createElement('div');
new Settings.SettingGroup('test', { shown:true }).appendTo(test).append(new Settings.Switch('test', 'test', true, (e)=>console.log(e)));
document.//AnyElement//.append(test);

Error occurs: [DOMObserver] Error in observer callback Error: Minified React error #130;

When trying to run code:

var { Settings } = ZeresPluginLibrary;
var test = document.createElement('div');
new Settings.SettingGroup('test', { shown:true }).appendTo(test).append(new Settings.Textbox('test', 'test', 'test', (e)=>console.log(e)));
document.//AnyElement//.append(test);

Error doesn't occur.

Similar behaviour occurs when trying to create Switch in getSettingsPanel() section.

I'm getting this error on Windows 10 in Discord version 308 with EnhancedDiscord installed and BetterDiscord plugins support enabled. This error did not occur earlier, it started to appear a few days ago. There is also a suspicion that along with that error observerCallback is now performing worse with large amount of emoji (or other DOM elements) when opening emoji panel (I'm judging by Performance debug record which reports that method in the line 6009 of 0PluginLibrary is causing a huge load)

Strencher commented 3 years ago

A screenshot of that error would be useful.

Japanese-Schoolgirl commented 3 years ago

A screenshot of that error would be useful.

image

zerebos commented 3 years ago

This has been fixed in the latest update