samfundev / BetterDiscordStuff

all my stuff for betterdiscord
MIT License
14 stars 10 forks source link

[ChannelTabs] Tabs don't update. #12

Open EnoralTheOutCast opened 1 month ago

EnoralTheOutCast commented 1 month ago

Before you submit an issue please restart your discord. If the issue is still there feel free to write a bug report.

Describe the bug A bit too confusing to explain, but, when you change channels in a tab it doesn't update. When you swap to that tab it sometimes sends you to the channel it shows, not the last you've opened.

To Reproduce Open a new tab(it would be your friends list) Switch to some channel in the newly opened tab. Switch to a different tab and then back to your new one. You're back in your friends list.

Expected behavior The tab header changes to whatever channel you switched to, and when you switch to that tab it stays on that channel.

Screenshots image The right most tab is active. But it shows a different channel. When i swap from it and back, it returns me to the channel it shows on the top, not the latest channel i had open.

Information (please complete the following information):

EnoralTheOutCast commented 1 month ago

Update: I rebooted my client, and it stopped working completely. UPD2: No it's back. I rebooted again. UPD3: I figured out why it stopped working. When you switch to a different channel in a tab (it's still stuck on the whatever was before).. And try to reboot, the plugin doesn't load.

wstirl commented 1 month ago

can confirm it doesn't work anymore

Kamiikaze commented 1 month ago

can confirm, too. Changing the location doesnt update the tab location. Switch to a new tab and than back, sends me back to an old location.

That's the error which came up when chaning the location in the tab:

web.cde6776….js:12 [PluginManager] Unable to fire onSwitch for ChannelTabs v2.6.13

 TypeError: Cannot read properties of undefined (reading 'getIconURL')
    at getCurrentIconUrl (ChannelTabs.plugin.js:1306:20)
    at eval (ChannelTabs.plugin.js:3438:20)
    at Array.map (<anonymous>)
    at ChannelTabs.onSwitch (ChannelTabs.plugin.js:3430:43)
    at N.onSwitch (renderer.js:5:30384)
    at a.emit (renderer.js:5:368671)
    at a.dispatch (renderer.js:5:19988)
    at renderer.js:5:20161

Edit: It seems this only occurs when trying to switch to another guild/server not when changing from from user to user.

Edit2: Found the issue. Seem const guild = GuildStore.getGuild(channel.guild_id); returns undefined, even if the guild_id is valid.

For those who want to keep using the plugin till its update you can change Line 1304 From:

return guild.getIconURL(40, false) || DefaultUserIconBlue;

To:

return guild ? guild.getIconURL(40, false) : DefaultUserIconBlue;

So the icons will be default ones, but its useable again.

Pharaoh2k commented 1 month ago

Thanks for the workaround @Kamiikaze Hopefully, a fix will be released soon.

ZenMasta commented 1 month ago

For those who want to keep using the plugin till its update you can change Line 1304 From:

return guild.getIconURL(40, false) || DefaultUserIconBlue;

To:

return guild ? guild.getIconURL(40, false) : DefaultUserIconBlue;

So the icons will be default ones, but its useable again.

Sweet work around. I'll gladly give up server icons for functionality until this is officially patched.

MegaShinySnivy commented 1 month ago

@samfundev This is a critical break, any chance you can take a look at this?

jack652 commented 1 month ago

same here also can't open a favorite in a new tab by right clicking it

JoshH265 commented 1 month ago

Also same issue, across all my devices which use the plugin

danny8376 commented 1 month ago

More proper temp fix here: Open ZeresPluginLibrary, go Line 381 change it from:

    get GuildStore() {return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__["default"].getByProps("getGuild", "getGuildIds");},

to:

    get GuildStore() {return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__["default"].getByProps("getGuild", "getGuildIds", "getRoles");},

should also fix multiple other plugins at the same time.

AhmedSherif0904 commented 1 month ago

More proper temp fix here: Open ZeresPluginLibrary, go Line 381 change it from:

    get GuildStore() {return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__["default"].getByProps("getGuild", "getGuildIds");},

to:

    get GuildStore() {return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__["default"].getByProps("getGuild", "getGuildIds", "getRoles");},

should also fix multiple other plugins at the same time.

this fixed other plugins for me but didnt fix channeltabs @danny8376

Phoenixlink1 commented 1 month ago

More proper temp fix here: Open ZeresPluginLibrary, go Line 381 change it from:

    get GuildStore() {return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__["default"].getByProps("getGuild", "getGuildIds");},

to:

    get GuildStore() {return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__["default"].getByProps("getGuild", "getGuildIds", "getRoles");},

should also fix multiple other plugins at the same time.

This fixed it for me!

Kamiikaze commented 1 month ago

More proper temp fix here: Open ZeresPluginLibrary, go Line 381 change it from:

    get GuildStore() {return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__["default"].getByProps("getGuild", "getGuildIds");},

to:

    get GuildStore() {return _webpackmodules__WEBPACK_IMPORTED_MODULE_1__["default"].getByProps("getGuild", "getGuildIds", "getRoles");},

should also fix multiple other plugins at the same time.

Thanks, fixed it for me! :)

samfundev commented 1 month ago

The fix for this has been released in v2.6.14. It has not been approved yet, but feel free to download the latest version in the mean time.

doqfgc commented 1 month ago

Fix did not work for me with just the 2.6.14 update; I also had to apply the Zeres Lib fix from https://github.com/samfundev/BetterDiscordStuff/issues/12#issuecomment-2394414004 and then it worked.