Merge branch 'lock-evenless' into 'develop'

Fix lock (no-repeats) button being interactive

See merge request pleroma/pleroma-fe!2120
This commit is contained in:
HJ 2025-03-30 18:09:05 +00:00
commit 3ba45efc2e
4 changed files with 6 additions and 4 deletions

View file

@ -0,0 +1 @@
Allow repeats of own posts with private scopes

View file

@ -124,6 +124,7 @@ export default {
}
},
doActionWrap (button, close = () => {}) {
if (this.button.interactive ? !this.button.interactive(this.funcArg) : false) return
this.$emit('interacted')
if (button.name === 'emoji') {
this.$refs.picker.showPicker()

View file

@ -12,7 +12,7 @@
:title="$t(button.label(funcArg))"
target="_blank"
:tabindex="0"
:disabled="buttonClass.disabled"
:disabled="this.button.interactive ? !this.button.interactive(this.funcArg) : false"
:href="getComponent(button) == 'a' ? button.link?.(funcArg) || remoteInteractionLink : undefined"
@click="doActionWrap(button, outerClose)"
>

View file

@ -30,8 +30,8 @@ export const BUTTONS = [{
label: ({ status }) => status.repeated
? 'tool_tip.unrepeat'
: 'tool_tip.repeat',
icon ({ status }) {
if (PRIVATE_SCOPES.has(status.visibility)) {
icon ({ status, currentUser }) {
if (currentUser.id !== status.user.id && PRIVATE_SCOPES.has(status.visibility)) {
return 'lock'
}
return 'retweet'
@ -40,7 +40,7 @@ export const BUTTONS = [{
active: ({ status }) => status.repeated,
counter: ({ status }) => status.repeat_num,
anonLink: true,
interactive: ({ status, loggedIn }) => loggedIn && !PRIVATE_SCOPES.has(status.visibility),
interactive: ({ status, currentUser }) => !!currentUser && (currentUser.id === status.user.id || !PRIVATE_SCOPES.has(status.visibility)),
toggleable: true,
confirm: ({ status, getters }) => !status.repeated && getters.mergedConfig.modalOnRepeat,
confirmStrings: {