From 6e9b22bd143546ef43f53026affc4c80f4934718 Mon Sep 17 00:00:00 2001
From: thororen1234 <78185467+thororen1234@users.noreply.github.com>
Date: Mon, 9 Dec 2024 21:20:38 -0500
Subject: [PATCH] Fix ChannelTabs on Canary
---
.../channelTabs/components/BookmarkContainer.tsx | 2 +-
.../channelTabs/components/ChannelTabsContainer.tsx | 10 ----------
src/equicordplugins/channelTabs/index.tsx | 8 --------
3 files changed, 1 insertion(+), 19 deletions(-)
diff --git a/src/equicordplugins/channelTabs/components/BookmarkContainer.tsx b/src/equicordplugins/channelTabs/components/BookmarkContainer.tsx
index 19565f96..02e6ab16 100644
--- a/src/equicordplugins/channelTabs/components/BookmarkContainer.tsx
+++ b/src/equicordplugins/channelTabs/components/BookmarkContainer.tsx
@@ -268,7 +268,7 @@ export default function BookmarkContainer(props: BasicChannelTabsProps & { userI
{bookmarks && !bookmarks.length &&
You have no bookmarks. You can add an open tab or hide this by right clicking it
}
- {bookmarks?.length &&
+ {Array.isArray(bookmarks) && bookmarks.length > 0 &&
bookmarks.map((_, i) => (
))
diff --git a/src/equicordplugins/channelTabs/components/ChannelTabsContainer.tsx b/src/equicordplugins/channelTabs/components/ChannelTabsContainer.tsx
index 91c14721..a9974903 100644
--- a/src/equicordplugins/channelTabs/components/ChannelTabsContainer.tsx
+++ b/src/equicordplugins/channelTabs/components/ChannelTabsContainer.tsx
@@ -30,16 +30,6 @@ export default function ChannelsTabsContainer(props: BasicChannelTabsProps) {
if (save) saveTabs(userId);
}, [userId]);
- useEffect(() => {
- // for some reason, the app directory is it's own page instead of a layer, so when it's opened
- // everything behind it is destroyed, including our container. this workaround is required
- // to properly add the container back without reinitializing everything
- if ((Vencord.Plugins.plugins.ChannelTabs as any).appDirectoryClosed) {
- setUserId(UserStore.getCurrentUser().id);
- update(false);
- }
- }, []);
-
const ref = useRef(null);
useEffect(() => {
diff --git a/src/equicordplugins/channelTabs/index.tsx b/src/equicordplugins/channelTabs/index.tsx
index d55d335b..884d1e3f 100644
--- a/src/equicordplugins/channelTabs/index.tsx
+++ b/src/equicordplugins/channelTabs/index.tsx
@@ -82,14 +82,6 @@ export default definePlugin({
match: /\i&&\((\i).maxHeight.{0,5}\)/,
replace: "$&;$1.maxHeight-=$self.containerHeight"
}
- },
- // workaround for app directory killing our component, see comments in ChannelTabContainer.tsx
- {
- find: ".ApplicationDirectoryEntrypointNames.EXTERNAL",
- replacement: {
- match: /(\.guildSettingsSection\).{0,30})},\[/,
- replace: "$1;$self.onAppDirectoryClose()},["
- }
}
],