fix: Add ShowConnections support for OpenMoreConnections

This commit is contained in:
Cooper 2024-06-29 22:04:40 -05:00 committed by GitHub
parent bfea1edf63
commit 9afcb75358
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -134,7 +134,7 @@ function ConnectionsComponent({ id, theme, simplified }: { id: string, theme: st
function CompactConnectionComponent({ connection, theme }: { connection: Connection, theme: string; }) { function CompactConnectionComponent({ connection, theme }: { connection: Connection, theme: string; }) {
const platform = platforms.get(useLegacyPlatformType(connection.type)); const platform = platforms.get(useLegacyPlatformType(connection.type));
const url = platform.getPlatformUserUrl?.(connection); var url = platform.getPlatformUserUrl?.(connection);
const img = ( const img = (
<img <img
@ -147,6 +147,11 @@ function CompactConnectionComponent({ connection, theme }: { connection: Connect
/> />
); );
if (Vencord.Plugins.isPluginEnabled("OpenMoreConnections") && url == null) {
const OpenMoreConnections = Vencord.Plugins.plugins.OpenMoreConnections as any as typeof import("../openMoreConnections").default;
url = OpenMoreConnections.addConnectionLink(connection) as string;
}
const TooltipIcon = url ? LinkIcon : CopyIcon; const TooltipIcon = url ? LinkIcon : CopyIcon;
return ( return (