New option: Confirm repeats

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: { methods: {
retweet () { retweet () {
if (!this.status.repeated) { if (this.mergedConfig.confirmRepeats) {
this.$store.dispatch('retweet', { id: this.status.id }) 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 { } 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 this.animated = true
setTimeout(() => { setTimeout(() => {

View file

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

View file

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

View file

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

View file

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