refactor ipc Main

This commit is contained in:
riqo 2021-06-19 11:21:47 -05:00
commit a22b3c68e5
13 changed files with 139 additions and 114 deletions

View file

@ -13,11 +13,11 @@ const { post, invoke } = useIpc();
export const invokeLogin = async (
payload: LoginPayload
): Promise<Profile | Error> => (
await invoke('account-login', JSON.stringify(payload))
await invoke('invoke-account-login', JSON.stringify(payload))
);
export const invokeLogout = async (): Promise<void> => (
await invoke("account-logout", null)
await invoke("invoke-account-logout", null)
);
/**
@ -27,11 +27,11 @@ export const invokeLogout = async (): Promise<void> => (
*/
export const postAudioChunk = (chunk: ArrayBuffer): void => (
post("audio-chunk", chunk)
post("post-audio-collect", chunk)
);
export const invokeReturnAudio = async (): Promise<ArrayBuffer[] | Error> => (
await invoke("get-audio", null)
await invoke("invoke-audio-flush", null)
);
/**
@ -45,5 +45,5 @@ export const invokeSession = async (cid: string): Promise<Profile | Error> => (
);
export const postMessage = (payload: Message): void => (
post('client-message', payload)
post('post-session-send', payload)
);