Files
discord-decomp/modules/voice_panel/native/hooks/useInviteMembersCallback.tsx
T
2026-11-01 12:12:55 +02:00

15 lines
761 B
TypeScript

// Metro module 15886 (f15887).
import { useCallback } from "react";
import ChannelStore from "../../../../stores/ChannelStore";
import { AnalyticsPages, InstantInviteSources } from "../../../../Constants";
import { navigateToNewGroupDM } from "../../../main_tabs_v2/helpers/NavigationRouteUtils.native";
import { showInstantInviteActionSheet } from "../../../instant_invite/native/InstantInviteUtils";
export function useInviteMembersCallback(a0) {
return useCallback(() => {
const channel = ChannelStore.getChannel(a0);
return channel != null ? channel.isPrivate() ? navigateToNewGroupDM(channel.id, AnalyticsPages.CHANNEL_CALL) : showInstantInviteActionSheet(channel, {
source: InstantInviteSources.VOICE_CHANNEL
}) : null;
}, [a0]);
}