Skip to content

Commit

Permalink
reduce logs
Browse files Browse the repository at this point in the history
  • Loading branch information
hellno committed Sep 4, 2023
1 parent 5d0547f commit 149ff40
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 25 deletions.
1 change: 0 additions & 1 deletion src/common/components/CastRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ export const CastRow = ({ cast, isSelected, showChannel, onSelect, channels, sho
const recastsCount = cast.reactions?.recasts?.length || cast.recasts?.count || 0;
const likesCount = cast.reactions?.likes?.length || cast.reactions?.count || 0;

console.log('cast reactions', cast.reactions)
const likeFids = cast.reactions?.fids || map(cast.reactions.likes, 'fid') || [];
const recastFids = cast.recasts?.fids || map(cast.reactions.recasts, 'fid') || [];
const reactions = {
Expand Down
6 changes: 3 additions & 3 deletions src/common/components/NewPostEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,17 @@ export default function NewPostEntry({ draftIdx, onPost, hideChannel }: NewPostE


const onSubmitPost = async () => {
console.log('onSubmitPost', draft)
// console.log('onSubmitPost', draft)
if (!draft || !account.privateKey || !account.platformAccountId) return;

if (draft.text.length > 0) {
await Promise.resolve(await publishPostDraft(draftIdx, account)).then((res) => {
console.log('NewPostEntry published post draft, res:', res);
// console.log('NewPostEntry published post draft, res:', res);
onPost();
}).catch((err) => {
console.log('NewPostEntry error publishing post draft', err);
}).finally(() => {
console.log('NewPostEntry finally')
// console.log('NewPostEntry finally')
});
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/common/helpers/farcaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const convertEditorCastToPublishableCast = async (draft: DraftType, castA
parentUrl,
}
}
console.log('convertEditorCastToPublishableCast done, result:', { ...cast })
// console.log('convertEditorCastToPublishableCast done, result:', { ...cast })
return cast;
}

Expand Down Expand Up @@ -93,7 +93,7 @@ export const publishCast = async ({ authorFid, privateKey, castBody }: PublishCa
network: NETWORK,
};

console.log('publishCast - dataOptions', { ...dataOptions }, 'castBody', { ...castBody })
// console.log('publishCast - dataOptions', { ...dataOptions }, 'castBody', { ...castBody })
// Step 2: create message
const cast = await makeCastAdd(
castBody,
Expand Down Expand Up @@ -128,7 +128,7 @@ export const publishReaction = async ({ authorFid, privateKey, reactionBody }: P
}

try {
console.log(`reactionBody`, reactionBody)
// console.log(`reactionBody`, reactionBody)
// Create an EIP712 Signer with the wallet that holds the custody address of the user
const ed25519Signer = new NobleEd25519Signer(toBytes(privateKey));

Expand All @@ -137,7 +137,7 @@ export const publishReaction = async ({ authorFid, privateKey, reactionBody }: P
network: NETWORK,
};

console.log('publishReaction - dataOptions', { ...dataOptions }, 'reactionBody', { ...reactionBody })
// console.log('publishReaction - dataOptions', { ...dataOptions }, 'reactionBody', { ...reactionBody })
// Step 2: create message
const reaction = await makeReactionAdd(
reactionBody,
Expand Down
25 changes: 8 additions & 17 deletions src/common/helpers/warpcastLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,17 @@ const generateKeyPair = async (): Promise<KeyPairType> => {


const createSignerRequest = async (publicKey: string, requestFid: string, signature: string, deadline: number): Promise<WarpcastLoginType> => {
const payload = { key: publicKey, requestFid, signature, deadline }
console.log('createSignerRequest', payload);

// const response = await fetch(`${WARPCAST_API_ENDPOINT}signed-key-requests`, {
// headers,
// method: "POST",
// body: JSON.stringify(payload),
// });
const payload = {
key: publicKey,
requestFid,
signature,
deadline,
}

const { token, deeplinkUrl } = await axios
.post(`${WARPCAST_API_ENDPOINT}signed-key-requests`, {
key: publicKey,
requestFid,
signature,
deadline,
})
.post(`${WARPCAST_API_ENDPOINT}signed-key-requests`, payload)
.then((response) => response.data.result.signedKeyRequest);

// console.log('createSignerRequest', response)
// const { deeplinkUrl, token }: WarpcastLoginType = (await response.json()).result.signedKeyRequest;
return { deeplinkUrl, token };
}

Expand Down Expand Up @@ -116,7 +107,7 @@ const getWarpcastSignerStatus = async (signerToken: string): Promise<{ status: W
}

const getWarpcastSigner = async (privateKey: string) => {
const privateKeyEncoded = toBytes(privateKey) // Uint8Array.from(privateKey.split(",").map(split => Number(split)))
const privateKeyEncoded = toBytes(privateKey);
return new NobleEd25519Signer(privateKeyEncoded);
}

Expand Down

0 comments on commit 149ff40

Please sign in to comment.