From 344833535641f6ce394d4cbf7cb1f423a2ea33dd Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Sat, 9 Mar 2024 18:52:41 +0900 Subject: [PATCH] feat: allow to set mute duration and notifications mute option (#2665) --- components/account/AccountMoreButton.vue | 17 ++++--- components/common/CommonCheckbox.vue | 10 +++- components/list/ListEntry.vue | 2 +- components/modal/DurationPicker.vue | 45 ++++++++++++++++ components/modal/ModalConfirm.vue | 37 ++++++++++++-- components/status/StatusActionsMore.vue | 10 ++-- composables/dialog.ts | 6 +-- composables/masto/relationship.ts | 65 +++++++++++++++--------- locales/en.json | 5 ++ types/index.ts | 13 ++++- 10 files changed, 163 insertions(+), 47 deletions(-) create mode 100644 components/modal/DurationPicker.vue diff --git a/components/account/AccountMoreButton.vue b/components/account/AccountMoreButton.vue index 7b041121..628b8465 100644 --- a/components/account/AccountMoreButton.vue +++ b/components/account/AccountMoreButton.vue @@ -25,13 +25,16 @@ function shareAccount() { } async function toggleReblogs() { - if (!relationship.value!.showingReblogs && await openConfirmDialog({ - title: t('confirm.show_reblogs.title'), - description: t('confirm.show_reblogs.description', [account.acct]), - confirm: t('confirm.show_reblogs.confirm'), - cancel: t('confirm.show_reblogs.cancel'), - }) !== 'confirm') - return + if (!relationship.value!.showingReblogs) { + const dialogChoice = await openConfirmDialog({ + title: t('confirm.show_reblogs.title'), + description: t('confirm.show_reblogs.description', [account.acct]), + confirm: t('confirm.show_reblogs.confirm'), + cancel: t('confirm.show_reblogs.cancel'), + }) + if (dialogChoice.choice !== 'confirm') + return + } const showingReblogs = !relationship.value?.showingReblogs relationship.value = await client.value.v1.accounts.$select(account.id).follow({ reblogs: showingReblogs }) diff --git a/components/common/CommonCheckbox.vue b/components/common/CommonCheckbox.vue index 24e35855..ba85155b 100644 --- a/components/common/CommonCheckbox.vue +++ b/components/common/CommonCheckbox.vue @@ -4,6 +4,8 @@ defineProps<{ hover?: boolean iconChecked?: string iconUnchecked?: string + checkedIconColor?: string + prependCheckbox?: boolean }>() const modelValue = defineModel() @@ -15,9 +17,12 @@ const modelValue = defineModel() v-bind="$attrs" @click.prevent="modelValue = !modelValue" > - {{ label }} + {{ label }}