Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
paulclindo committed Nov 8, 2023
1 parent 995d0ad commit d876554
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion apps/shinkai-app/src/pages/CreateChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const CreateChat: React.FC = () => {
if (!auth) return;
const [receiver, ...rest] = data.receiver.split('/');

createChat({
await createChat({
sender: auth.shinkai_identity,
senderSubidentity: auth.profile,
receiver,
Expand Down
2 changes: 0 additions & 2 deletions apps/shinkai-app/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ const MessageButton = ({ inbox }: { inbox: SmartInbox }) => {

const onSubmit = async (data: z.infer<typeof updateInboxNameSchema>) => {
if (!auth) return;
console.log('data', data);
await updateInboxName({
sender: auth?.shinkai_identity ?? '',
senderSubidentity: auth?.profile,
receiver: auth.shinkai_identity,
receiverSubidentity: '',
my_device_encryption_sk: auth.my_device_encryption_sk,
my_device_identity_sk: auth.my_device_identity_sk,
node_encryption_pk: auth.node_encryption_pk,
Expand Down
1 change: 0 additions & 1 deletion libs/shinkai-message-ts/src/api/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ export const updateInboxName = async (
sender: string,
sender_subidentity: string,
receiver: string,
receiver_subidentity: string,
setupDetailsState: CredentialsPayload,
inboxName: string,
inboxId: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { updateInboxName as updateInboxNameApi } from '@shinkai_network/shinkai-message-ts/api';
import { type ShinkaiMessage } from '@shinkai_network/shinkai-message-ts/models';

import { UpdateInboxNamebInput } from './types';
import { UpdateInboxNameInput } from './types';
export type SmartInbox = {
custom_name: string;
inbox_id: string;
Expand All @@ -12,20 +12,19 @@ export const updateInboxName = async ({
senderSubidentity,
sender,
receiver,
receiverSubidentity,
my_device_encryption_sk,
my_device_identity_sk,
node_encryption_pk,
profile_encryption_sk,
profile_identity_sk,
inboxName,
inboxId,
}: UpdateInboxNamebInput) => {
}: UpdateInboxNameInput) => {
const response = await updateInboxNameApi(
sender,
senderSubidentity,
receiver,
receiverSubidentity,

{
my_device_encryption_sk,
my_device_identity_sk,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { CredentialsPayload } from '@shinkai_network/shinkai-message-ts/models';

export type UpdateInboxNamebInput = CredentialsPayload & {
export type UpdateInboxNameInput = CredentialsPayload & {
senderSubidentity: string;
sender: string;
receiver: string;
receiverSubidentity: string;
inboxName: string;
inboxId: string;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { useMutation } from '@tanstack/react-query';

import { FunctionKey, queryClient } from '../../constants';
import { updateInboxName } from '.';
import type { UpdateInboxNamebInput, UpdateInboxNameOutput } from './types';
import type { UpdateInboxNameInput, UpdateInboxNameOutput } from './types';

type Options = UseMutationOptions<
UpdateInboxNameOutput,
Error,
UpdateInboxNamebInput
UpdateInboxNameInput
>;

export const useUpdateInboxName = (options?: Options) => {
Expand Down

0 comments on commit d876554

Please sign in to comment.