mirror of
https://github.com/YunoHost-Apps/pixelfed_ynh.git
synced 2024-09-03 20:06:04 +02:00
Add confirmation check to post deletion function
This commit is contained in:
parent
1d07c4a72e
commit
ebbe842416
1 changed files with 24 additions and 21 deletions
|
@ -56,11 +56,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-md-8 px-0 mx-0">
|
<div class="col-12 col-md-8 px-0 mx-0">
|
||||||
<div class="postPresenterLoader text-center">
|
<div class="postPresenterLoader text-center">
|
||||||
<div class="lds-ring"><div></div><div></div><div></div><div></div></div>
|
<div class="lds-ring"><div></div><div></div><div></div><div></div></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="postPresenterContainer d-none d-flex justify-content-center align-items-center">
|
<div class="postPresenterContainer d-none d-flex justify-content-center align-items-center">
|
||||||
<div v-if="status.pf_type === 'photo'" class="w-100">
|
<div v-if="status.pf_type === 'photo'" class="w-100">
|
||||||
<photo-presenter :status="status"></photo-presenter>
|
<photo-presenter :status="status"></photo-presenter>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else-if="status.pf_type === 'video'" class="w-100">
|
<div v-else-if="status.pf_type === 'video'" class="w-100">
|
||||||
|
@ -164,10 +164,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<b-modal ref="likesModal"
|
<b-modal ref="likesModal"
|
||||||
id="l-modal"
|
id="l-modal"
|
||||||
hide-footer
|
hide-footer
|
||||||
centered
|
centered
|
||||||
title="Likes"
|
title="Likes"
|
||||||
body-class="list-group-flush p-0">
|
body-class="list-group-flush p-0">
|
||||||
<div class="list-group">
|
<div class="list-group">
|
||||||
|
@ -195,10 +195,10 @@
|
||||||
</infinite-loading>
|
</infinite-loading>
|
||||||
</div>
|
</div>
|
||||||
</b-modal>
|
</b-modal>
|
||||||
<b-modal ref="sharesModal"
|
<b-modal ref="sharesModal"
|
||||||
id="s-modal"
|
id="s-modal"
|
||||||
hide-footer
|
hide-footer
|
||||||
centered
|
centered
|
||||||
title="Shares"
|
title="Shares"
|
||||||
body-class="list-group-flush p-0">
|
body-class="list-group-flush p-0">
|
||||||
<div class="list-group">
|
<div class="list-group">
|
||||||
|
@ -281,7 +281,7 @@ export default {
|
||||||
$('head title').text(title);
|
$('head title').text(title);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
authCheck() {
|
authCheck() {
|
||||||
let authed = $('body').hasClass('loggedIn');
|
let authed = $('body').hasClass('loggedIn');
|
||||||
|
@ -495,19 +495,22 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
deletePost() {
|
deletePost() {
|
||||||
if($('body').hasClass('loggedIn') == false) {
|
var result = confirm('Are you sure you want to delete this post?');
|
||||||
return;
|
if (result) {
|
||||||
}
|
if($('body').hasClass('loggedIn') == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
axios.post('/i/delete', {
|
axios.post('/i/delete', {
|
||||||
type: 'status',
|
type: 'status',
|
||||||
item: this.status.id
|
item: this.status.id
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
swal('Success', 'You have successfully deleted this post', 'success');
|
swal('Success', 'You have successfully deleted this post', 'success');
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
swal('Error', 'Something went wrong. Please try again later.', 'error');
|
swal('Error', 'Something went wrong. Please try again later.', 'error');
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Reference in a new issue