Files
fusion/packages/dashboard/app/hooks/useShellConnection.ts
Fusion 7b9e5259d3 feat(FN-3403): add shell multi-profile support with connection manager onbo
Merges shell multi-profile support for desktop (FN-3403) — spanning new connection-manager flows, shell onboarding interoperability, mobile connection profiles, desktop IPC/shell-settings plumbing, and tokenized titlebar styles — with a secondary migration of the WhatsApp plugin to the Baileys pairi

Fusion-Task-Id: FN-3403
2026-05-07 18:35:45 -07:00

26 lines
941 B
TypeScript

import { useCallback } from "react";
import { useShellContext } from "../context/ShellContext";
import {
createOrUpdateProfile,
deleteProfile,
normalizeShellState,
selectActiveProfile,
} from "../utils/shell-connection-settings";
import type { ShellConnectionProfileInput } from "../types/native-shell";
export function useShellConnection() {
const context = useShellContext();
const saveProfile = useCallback((profile: ShellConnectionProfileInput) => createOrUpdateProfile(context.shellApi, profile), [context.shellApi]);
const removeProfile = useCallback((profileId: string) => deleteProfile(context.shellApi, profileId), [context.shellApi]);
const setActiveProfile = useCallback((profileId: string | null) => selectActiveProfile(context.shellApi, profileId), [context.shellApi]);
return {
...context,
state: normalizeShellState(context.state),
saveProfile,
removeProfile,
setActiveProfile,
};
}