Strencher / BetterDiscordStuff

A collection of my BetterDiscord plugins
https://strencher.github.io/BetterDiscordStuff/
358 stars 226 forks source link

Platform Indicators Causing a loop of loading screens when enabled #369

Closed SynatomicFox closed 10 months ago

SynatomicFox commented 10 months ago

As described in the title, as soon as you enable this plugin, discord starts looping with the loading screen, the only other plugin i have enabled is PinDM's by DevilBro and his plugin library.

Technetium1 commented 10 months ago

Waiting for this: https://github.com/rauenzi/BDPluginLibrary/issues/207

NicoMachine commented 10 months ago

i found a version of ZeresPluginLibrary that works its version 2.0.19 i searched in the builds and the latest works https://github.com/rauenzi/BDPluginLibrary/actions/runs/6674121161

i got it from the Artifacts link down the link and in Artifacts its in releases in the Artifacts file insite the github-pages.zip

Technetium1 commented 10 months ago

2.0.19 from https://github.com/rauenzi/BDPluginLibrary/commit/99d49cd7a5041c8f7552e79df9cec88670cce36c brings the library back into working order, but it still doesn't solve the separate looping issue with platform indicators.

Enrico9431 commented 10 months ago

Seems like the issue lies with this plugin as I also just found out that removing it stops the constant reloading. Hopefully he could also fix #367 whilst he's at it.

zrodevkaan commented 10 months ago

Nah Strencher has some weird undefined _ reference that I can't seem to find where its defined. For a (temp) fix replace

if (this.state && _.isEqual(this.state, this.getState())) return;

with

if (this.state /*&&_.isEqual(this.state, this.getState())*/) return;

The plugin disrupts the Gateway socket which causes weird reloading.

liigmabalz commented 10 months ago

Nah Strencher has some weird undefined _ reference that I can't seem to find where its defined. For a (temp) fix replace

if (this.state && _.isEqual(this.state, this.getState())) return;

with

if (this.state /*&&_.isEqual(this.state, this.getState())*/) return;

The plugin disrupts the Gateway socket which causes weird reloading.

yo, thanks for the fix

Knewest commented 10 months ago

Nah Strencher has some weird undefined _ reference that I can't seem to find where its defined. For a (temp) fix replace

if (this.state && _.isEqual(this.state, this.getState())) return;

with

if (this.state /*&&_.isEqual(this.state, this.getState())*/) return;

The plugin disrupts the Gateway socket which causes weird reloading.

Can confirm this fixed the issue of loop reloading when DMs are opened.

Strencher commented 10 months ago

This is not a very idea fix, it will cause high resources usage. _.isEqual was a function provided by lodash which discord removed recently

zrodevkaan commented 10 months ago

so ig let me find a new one

zrodevkaan commented 10 months ago

Alright, I believe to come up with a fix. My apologizes for that fix.

Using isEqual = BdApi.Webpack.getModule(x=>x.isEqual, {searchExports:true}); believed to work? I am not sure if this is a fix you want.

 isEqual = BdApi.Webpack.getModule(x=>x.isEqual, {searchExports:true});
                handleChange = () => {
                    if (this._destroyed) return false;

                    if (this.state && this.isEqual(this.state, this.getState())) return;

                    this.mount();
                }

Or maybe BdApi.Webpack.getModule(x=>x.isEqual && x.is) could work. I never used Lodash so my fix could be completely wrong.

Knewest commented 10 months ago

Alright, I believe to come up with a fix. My apologizes for that fix.

Using isEqual = BdApi.Webpack.getModule(x=>x.isEqual, {searchExports:true}); believed to work? I am not sure if this is a fix you want.

 isEqual = BdApi.Webpack.getModule(x=>x.isEqual, {searchExports:true});
                handleChange = () => {
                    if (this._destroyed) return false;

                    if (this.state && this.isEqual(this.state, this.getState())) return;

                    this.mount();
                }

I can confirm that this also fixes the loop loading error in DMs. It doesn't appear to cause any issues when using the plugin.

Enrico9431 commented 10 months ago

Alright, I believe to come up with a fix. My apologizes for that fix.

Using isEqual = BdApi.Webpack.getModule(x=>x.isEqual, {searchExports:true}); believed to work? I am not sure if this is a fix you want.

 isEqual = BdApi.Webpack.getModule(x=>x.isEqual, {searchExports:true});
                handleChange = () => {
                    if (this._destroyed) return false;

                    if (this.state && this.isEqual(this.state, this.getState())) return;

                    this.mount();
                }

Or maybe BdApi.Webpack.getModule(x=>x.isEqual && x.is) could work. I never used Lodash so my fix could be completely wrong.

I'm confused now as to what exactly I gotta replace with what?

Strencher commented 10 months ago

I think @ImAFrogOwO solutions aren't very helpful. I don't have time to make a fix, sorry about that. Maybe @domi-btnr has time to make a quality fix.

zrodevkaan commented 10 months ago

Yeah so apparently I might not be helpful, but you might not be right either considering BdApi.findModuleByProps("isEqual","add") or BdApi.Webpack.getModule(x=>x.isEqual, {searchExports:true}); returns lodash which you said is removed by disccord.

Just trying to help out taking into consideration you don't have time.

domi-btnr commented 10 months ago

I think @ImAFrogOwO solutions aren't very helpful. I don't have time to make a fix, sorry about that. Maybe @domi-btnr has time to make a quality fix.

BdApi.findModuleByProps("isEqual","add") seems to be the loadash isEqual function. Tested it, and it works without any Error nor Performance issues as far as I can tell. Fixed in ac1c826