Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/react/src/post/useBookmarkPost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
UnauthenticatedError,
UnexpectedError,
} from '@lens-protocol/client';
import { bookmarkPost } from '@lens-protocol/client/actions';
import { bookmarkPost, fetchPost } from '@lens-protocol/client/actions';

import { type UseAsyncTask, useAuthenticatedAsyncTask } from '../helpers';

Expand Down Expand Up @@ -32,6 +32,8 @@ export function useBookmarkPost(): UseAsyncTask<
UnauthenticatedError | UnexpectedError
> {
return useAuthenticatedAsyncTask((sessionClient, request) =>
bookmarkPost(sessionClient, request),
bookmarkPost(sessionClient, request).andTee(() =>
fetchPost(sessionClient, { post: request.post }),
),
);
}
6 changes: 4 additions & 2 deletions packages/react/src/post/useUndoBookmarkPost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
UnauthenticatedError,
UnexpectedError,
} from '@lens-protocol/client';
import { undoBookmarkPost } from '@lens-protocol/client/actions';
import { fetchPost, undoBookmarkPost } from '@lens-protocol/client/actions';

import { type UseAsyncTask, useAuthenticatedAsyncTask } from '../helpers';

Expand Down Expand Up @@ -32,6 +32,8 @@ export function useUndoBookmarkPost(): UseAsyncTask<
UnauthenticatedError | UnexpectedError
> {
return useAuthenticatedAsyncTask((sessionClient, request) =>
undoBookmarkPost(sessionClient, request),
undoBookmarkPost(sessionClient, request).andTee(() =>
fetchPost(sessionClient, { post: request.post }),
),
);
}
Loading