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
This commit is contained in:
@@ -1,5 +1,25 @@
|
||||
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() {
|
||||
return useShellContext();
|
||||
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,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user