add navbar listener

This commit is contained in:
riqo 2021-06-23 07:52:06 -05:00
commit d00fb0f3be
9 changed files with 82 additions and 32 deletions

View file

@ -14,7 +14,7 @@ const { post, invoke } = useIpc();
export const invokeLogin = async (
payload: LoginPayload
): Promise<Profile | Error> => (
await invoke('invoke-account-login', JSON.stringify(payload))
await invoke('invoke-account-login', payload)
);
export const invokeLogout = async (): Promise<void> => (
@ -41,10 +41,6 @@ export const invokeReturnAudio = async (): Promise<ArrayBuffer[] | Error> => (
*
*/
export const invokeSession = async (cid: string): Promise<Profile | Error> => (
await invoke("messenger-init", cid)
);
export const postMessage = (payload: Message): void => (
post('post-session-send', payload)
);
@ -53,6 +49,25 @@ export const postAppMount = (): void => (
post('post-app-mount', null)
);
/**
*
* Nav bar endpoints
*
*/
export const postNavBar = (payload: string): void => (
post('post-nav-bar', payload)
);
/**
*
* Window focus endpoint
*
*/
export const postWindowBlur = (payload: { isFocused: boolean; }): void => (
post('post-window-focus', payload)
);
/**
*