mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
Merge 9d62c8be5d into a23dfff6cf
This commit is contained in:
commit
684c96ebb0
2 changed files with 11 additions and 4 deletions
|
|
@ -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'));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue