This commit is contained in:
Basharat Ahmad Khan 2025-10-16 15:46:49 -04:00 committed by GitHub
commit 684c96ebb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 4 deletions

View file

@ -103,7 +103,7 @@
try { try {
const expirationDate = expirationOption > 0 ? DateTime.now().plus(expirationOption).toISO() : null; const expirationDate = expirationOption > 0 ? DateTime.now().plus(expirationOption).toISO() : null;
await updateSharedLink({ const updatedLink = await updateSharedLink({
id: editingLink.id, id: editingLink.id,
sharedLinkEditDto: { sharedLinkEditDto: {
description, description,
@ -121,7 +121,7 @@
message: $t('edited'), message: $t('edited'),
}); });
onClose(); onClose(updatedLink);
} catch (error) { } catch (error) {
handleError(error, $t('errors.failed_to_edit_shared_link')); handleError(error, $t('errors.failed_to_edit_shared_link'));
} }

View file

@ -54,8 +54,15 @@
} }
}; };
const handleEditDone = async () => { const handleEditDone = async (updatedLink?: SharedLinkResponseDto) => {
if (updatedLink) {
const index = sharedLinks.findIndex((link) => link.id === updatedLink.id);
if (index !== -1) {
sharedLinks[index] = updatedLink;
}
} else {
await refresh(); await refresh();
}
await goto(AppRoute.SHARED_LINKS); await goto(AppRoute.SHARED_LINKS);
}; };