New option: Confirm repeats
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful

This commit is contained in:
eris 2022-08-25 05:32:40 +00:00
parent 1f2b059320
commit cb7c816980
5 changed files with 29 additions and 3 deletions

View file

@ -12,10 +12,24 @@ const RetweetButton = {
},
methods: {
retweet () {
if (!this.status.repeated) {
this.$store.dispatch('retweet', { id: this.status.id })
if (this.mergedConfig.confirmRepeats) {
if (!this.status.repeated) {
const confirmed = window.confirm(this.$t('status.repeat_confirm'))
if (confirmed) {
this.$store.dispatch('retweet', { id: this.status.id })
}
} else {
const confirmed = window.confirm(this.$t('status.unrepeat_confirm'))
if (confirmed) {
this.$store.dispatch('unretweet', { id: this.status.id })
}
}
} else {
this.$store.dispatch('unretweet', { id: this.status.id })
if (!this.status.repeated) {
this.$store.dispatch('retweet', { id: this.status.id })
} else {
this.$store.dispatch('unretweet', { id: this.status.id })
}
}
this.animated = true
setTimeout(() => {

View file

@ -172,6 +172,13 @@
{{ $t('settings.autohide_floating_post_button') }}
</BooleanSetting>
</li>
<li>
<BooleanSetting
path="confirmRepeats"
>
{{ $t('settings.confirm_repeats') }}
</BooleanSetting>
</li>
</ul>
</div>
<div class="setting-item">

View file

@ -396,6 +396,7 @@
"collapse_subject": "Collapse posts with subjects",
"composing": "Composing",
"confirm_new_password": "Confirm new password",
"confirm_repeats": "Require confirmation for repeats",
"conversation_display": "Conversation display style",
"conversation_display_linear": "Linear-style",
"conversation_display_tree": "Tree-style",
@ -836,6 +837,8 @@
"pinned": "Pinned",
"plus_more": "+{number} more",
"remove_attachment": "Remove attachment",
"repeat_confirm": "Repeat this post?",
"unrepeat_confirm": "Undo repeat?",
"repeats": "Repeats",
"replies_list": "Replies:",
"replies_list_with_others": "Replies (+{numReplies} other): | Replies (+{numReplies} others):",

View file

@ -43,6 +43,7 @@ export const defaultState = {
hideSiteName: undefined, // instance default
hideAttachments: false,
hideAttachmentsInConv: false,
confirmRepeats: undefined, // instance default
maxThumbnails: 16,
hideNsfw: true,
preloadImage: true,

View file

@ -38,6 +38,7 @@ const defaultState = {
hideSiteName: false,
hideUserStats: false,
muteBotStatuses: false,
confirmRepeats: false,
loginMethod: 'password',
logo: '/static/logo.svg',
logoMargin: '.2em',