📸 refactor: Refresh Shared Links With Latest Snapshot (#13095)
Some checks are pending
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
GitNexus Index / index (push) Waiting to run
GitNexus Index / post-index (push) Blocked by required conditions

* fix: refresh shared links with latest target

* fix: validate shared link refresh payload
This commit is contained in:
Danny Avila 2026-05-13 19:38:28 -04:00 • committed by GitHub
parent 7f58e4c2ed
commit ae75fb68a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 150 additions and 20 deletions

View file

@ -92,7 +92,7 @@ export default function SharedLinkButton({
if (!shareId) {
return;
}
const updateShare = await mutateAsync({ shareId });
const updateShare = await mutateAsync({ shareId, targetMessageId });
const newLink = generateShareLink(updateShare.shareId);
setSharedLink(newLink);
setAnnouncement(localize('com_ui_link_refreshed'));

View file

@ -176,17 +176,17 @@ export const useCreateSharedLinkMutation = (
};
export const useUpdateSharedLinkMutation = (
options?: t.MutationOptions<t.TUpdateShareLinkRequest, { shareId: string }>,
): UseMutationResult<t.TSharedLinkResponse, unknown, { shareId: string }, unknown> => {
options?: t.MutationOptions<t.TUpdateShareLinkRequest, t.TUpdateShareLinkRequest>,
): UseMutationResult<t.TSharedLinkResponse, unknown, t.TUpdateShareLinkRequest, unknown> => {
const queryClient = useQueryClient();
const { onSuccess, ..._options } = options || {};
return useMutation(
({ shareId }) => {
({ shareId, targetMessageId }) => {
if (!shareId) {
throw new Error('Share ID is required');
}
return dataService.updateSharedLink(shareId);
return dataService.updateSharedLink(shareId, targetMessageId);
},
{
onSuccess: (_data: t.TSharedLinkResponse, vars, context) => {