feat: show delete confirmation dialog when clicking "Delete & re-draft" menu (#2296)

Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
zio/stable
TAKAHASHI Shuuji 2023-08-02 19:41:47 +09:00 committed by GitHub
parent 8df73b13bd
commit 0a8cc317a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -81,7 +81,13 @@ async function deleteStatus() {
}
async function deleteAndRedraft() {
// TODO confirm to delete
if (await openConfirmDialog({
title: t('confirm.delete_posts.title'),
confirm: t('confirm.delete_posts.confirm'),
cancel: t('confirm.delete_posts.cancel'),
}) !== 'confirm')
return
if (process.dev) {
// eslint-disable-next-line no-alert
const result = confirm('[DEV] Are you sure you want to delete and re-draft this post?')