Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions web/src/lib/modals/SharedLinkCreateModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
try {
const expirationDate = expirationOption > 0 ? DateTime.now().plus(expirationOption).toISO() : null;

await updateSharedLink({
const updatedLink = await updateSharedLink({
id: editingLink.id,
sharedLinkEditDto: {
description,
Expand All @@ -121,7 +121,7 @@
message: $t('edited'),
});

onClose();
onClose(updatedLink);
} catch (error) {
handleError(error, $t('errors.failed_to_edit_shared_link'));
}
Expand Down
11 changes: 9 additions & 2 deletions web/src/routes/(user)/shared-links/[[id=id]]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,15 @@
}
};

const handleEditDone = async () => {
await refresh();
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 goto(AppRoute.SHARED_LINKS);
};

Expand Down
Loading