New option: Confirm repeats
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
This commit is contained in:
parent
1f2b059320
commit
cb7c816980
5 changed files with 29 additions and 3 deletions
|
@ -12,11 +12,25 @@ const RetweetButton = {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
retweet () {
|
retweet () {
|
||||||
|
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 {
|
||||||
if (!this.status.repeated) {
|
if (!this.status.repeated) {
|
||||||
this.$store.dispatch('retweet', { id: this.status.id })
|
this.$store.dispatch('retweet', { id: this.status.id })
|
||||||
} else {
|
} else {
|
||||||
this.$store.dispatch('unretweet', { id: this.status.id })
|
this.$store.dispatch('unretweet', { id: this.status.id })
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.animated = true
|
this.animated = true
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.animated = false
|
this.animated = false
|
||||||
|
|
|
@ -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">
|
||||||
|
|
|
@ -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):",
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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',
|
||||||
|
|
Loading…
Reference in a new issue