Skip to content

Commit

Permalink
fix: messages not appearing after sending them
Browse files Browse the repository at this point in the history
  • Loading branch information
ImLunaHey committed Jan 4, 2025
1 parent 754cd0e commit 785a9b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/bluesky/hooks/useSendMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function useSendMessage({ convoId }: { convoId: string }) {
mutationFn: async ({ message }: { message: string }) => {
// @ts-expect-error bsky_chat does in fact work
const proxy = agent.withProxy('bsky_chat', 'did:web:api.bsky.chat');
proxy.api.chat.bsky.convo.sendMessage({
await proxy.api.chat.bsky.convo.sendMessage({
convoId,
message: {
text: message,
Expand Down
4 changes: 2 additions & 2 deletions src/routes/messages/$convoId.lazy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ type TiptapMethods = {
function ReplyBox() {
const queryClient = useQueryClient();
const { convoId } = Route.useParams();
const { mutate, isPending } = useSendMessage({ convoId });
const { mutateAsync, isPending } = useSendMessage({ convoId });
const [value, setValue] = useState<string>('');
const ref = useRef<TiptapMethods | null>(null);
const onClick = async () => {
const message = value.trim();
if (!message) return;
mutate(
await mutateAsync(
{ message: message },
{
onSuccess: () => {
Expand Down

0 comments on commit 785a9b0

Please sign in to comment.