diff --git a/components/SelectGroup.tsx b/components/SelectGroup.tsx index 03bac68..6ab04e4 100644 --- a/components/SelectGroup.tsx +++ b/components/SelectGroup.tsx @@ -50,25 +50,25 @@ export const SelectGroup: React.FC = (props) => { const [searchValue, setSearchValue] = useState("") const [loading, setLoading] = useState(false) - const loadOptions = useDebouncedCallback< - (inputValue: string) => Promise - >(async (inputValue: string) => { - setLoading(true) - const res = await fetch( - `/api/search/users?twitterHandle=${encodeURIComponent(inputValue)}`, - { method: "POST" } - ) - - if (res.status === 200) { - const { users } = await res.json() - console.log("got users", users) - setLoading(false) - return users - } else { - setLoading(false) - return [] - } - }, 500) + const loadOptions = useDebouncedCallback( + (inputValue: string, callback: (group: User[]) => void) => { + setLoading(true) + fetch( + `/api/search/users?twitterHandle=${encodeURIComponent(inputValue)}`, + { method: "POST" } + ).then(async (res) => { + if (res.status === 200) { + const { users } = await res.json() + setLoading(false) + callback(users) + } else { + setLoading(false) + callback([]) + } + }) + }, + 200 + ) const isClearable = useMemo( () => props.group.some((user) => user.publicKey !== user?.publicKey), diff --git a/utils/client/prove.ts b/utils/client/prove.ts index 4347810..3fbf01f 100644 --- a/utils/client/prove.ts +++ b/utils/client/prove.ts @@ -53,7 +53,7 @@ export async function verifyMessage( return false } - console.log("message hash is good.") + console.log("message hashes match!") console.log("verifying message proof...") const verified = await snarkjs.groth16.verify( vKeys.sign, @@ -61,7 +61,7 @@ export async function verifyMessage( message.proof ) if (verified) { - console.log("message proof is good.") + console.log("message proof is valid!") } else { console.error("invalid message proof!") }