Skip to content

Commit

Permalink
Fix delete not closing parent info dialog (#2684)
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria authored Nov 14, 2024
1 parent 8c12646 commit c513457
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
13 changes: 12 additions & 1 deletion resources/js/components/drawers/AlbumEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@
<div class="w-full xl:w-5/6 flex justify-center flex-wrap mb-4 sm:mt-7 pl-7" v-if="activeTab === 3 && (canDelete || canTransfer)">
<!-- @vue-expect-error -->
<AlbumTransfer v-if="canTransfer" :album="props.album" :key="'transfer_' + props.album.id" />
<AlbumDelete v-if="canDelete" :album="props.album" :is_model_album="props.config.is_model_album" :key="'delete_' + props.album.id" />
<AlbumDelete
v-if="canDelete"
:album="props.album"
:is_model_album="props.config.is_model_album"
:key="'delete_' + props.album.id"
@deleted="close"
/>
</div>
</Collapse>
</template>
Expand Down Expand Up @@ -96,4 +102,9 @@ const canShare = computed(() => props.album.rights.can_share_with_users && numUs
const canMove = computed(() => props.config.is_model_album && props.album.rights.can_move);
const canTransfer = computed(() => props.config.is_base_album && numUsers.value > 1 && props.album.rights.can_transfer);
const canDelete = computed(() => props.config.is_base_album && props.album.rights.can_delete);
function close() {
activeTab.value = 0;
are_details_open.value = false;
}
</script>
5 changes: 5 additions & 0 deletions resources/js/components/forms/album/AlbumDelete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ const props = defineProps<{
const router = useRouter();
const title = computed(() => sprintf(trans("lychee.DELETE_ALBUM_CONFIRMATION"), props.album.title));
const emits = defineEmits<{
deleted: [];
}>();
function execute() {
AlbumService.delete([props.album.id]).then(() => {
emits("deleted");
if (props.is_model_album) {
const album = props.album as App.Http.Resources.Models.AlbumResource;
AlbumService.clearCache(album.parent_id);
Expand Down

0 comments on commit c513457

Please sign in to comment.