refactor: album delete watch

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/888/head
Varun Patil 2023-10-23 18:51:44 -07:00
parent 25e2c42830
commit 4f51e866c4
1 changed files with 9 additions and 22 deletions

View File

@ -44,21 +44,17 @@ export default defineComponent({
data: () => ({
show: false,
user: '',
name: '',
}),
watch: {
$route() {
this.refreshParams();
},
},
mounted() {
this.refreshParams();
},
computed: {
user() {
return this.$route.params.user;
},
name() {
return this.$route.params.name;
},
owned() {
return this.user === utils.uid;
},
@ -73,11 +69,6 @@ export default defineComponent({
this.show = true;
},
refreshParams() {
this.user = this.$route.params.user ?? String();
this.name = this.$route.params.name ?? String();
},
async save() {
try {
await client.deleteFile(dav.getAlbumPath(this.user, this.name));
@ -85,11 +76,7 @@ export default defineComponent({
this.close();
} catch (error) {
console.log(error);
showError(
this.t('photos', 'Failed to delete {name}.', {
name: this.name,
}),
);
showError(this.t('photos', 'Failed to delete {name}.', { name: this.name }));
}
},
},