fix: move to folder stuck

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/888/head
Varun Patil 2023-10-24 02:59:34 -07:00
parent e81e65cf7f
commit 79ae924a00
1 changed files with 4 additions and 5 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<Modal ref="modal" @close="cleanup" size="normal" v-if="processing"> <Modal ref="modal" @close="cleanup" size="normal" v-if="show">
<template #title> <template #title>
{{ t('memories', 'Move to folder') }} {{ t('memories', 'Move to folder') }}
</template> </template>
@ -39,7 +39,6 @@ export default defineComponent({
data: () => ({ data: () => ({
photos: [] as IPhoto[], photos: [] as IPhoto[],
photosDone: 0, photosDone: 0,
processing: false,
}), }),
created() { created() {
@ -50,13 +49,13 @@ export default defineComponent({
methods: { methods: {
open(photos: IPhoto[]) { open(photos: IPhoto[]) {
this.photosDone = 0; this.photosDone = 0;
this.processing = false; this.show = false;
this.photos = photos; this.photos = photos;
this.chooseFolderPath(); this.chooseFolderPath();
}, },
cleanup() { cleanup() {
this.processing = false; this.show = false;
this.photos = []; this.photos = [];
}, },
@ -68,7 +67,7 @@ export default defineComponent({
); );
// Fails if the target exists, same behavior with Nextcloud files implementation. // Fails if the target exists, same behavior with Nextcloud files implementation.
const gen = dav.movePhotos(this.photos, destination, false); const gen = dav.movePhotos(this.photos, destination, false);
this.processing = true; this.show = true;
for await (const fids of gen) { for await (const fids of gen) {
this.photosDone += fids.filter((f) => f).length; this.photosDone += fids.filter((f) => f).length;