Disable visibility menu in reply if parent post is not public

This commit is contained in:
silverpill 2023-02-03 00:03:06 +00:00
parent 36a028e9f3
commit b0f7042008
2 changed files with 12 additions and 0 deletions

View file

@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- Restore payment details when navigating back to subscription payment page from another page.
- Disable visibility menu in reply if parent post is not public.
## [1.12.0] - 2023-01-26

View file

@ -62,6 +62,7 @@
v-click-away="hideVisibilityMenu"
>
<button
v-if="canChangeVisibility()"
type="button"
class="icon"
title="Change visibility"
@ -69,6 +70,9 @@
>
<visibility-icon :visibility="visibility"></visibility-icon>
</button>
<span v-else class="icon">
<visibility-icon :visibility="visibility"></visibility-icon>
</span>
<menu v-if="visibilityMenuVisible" class="dropdown-menu">
<li v-for="[value, display] in visibilityMap" :key="value">
<button
@ -268,6 +272,13 @@ function removeAttachment(index: number) {
attachments.splice(index, 1)
}
function canChangeVisibility(): boolean {
return (
props.inReplyTo === null ||
props.inReplyTo.visibility === Visibility.Public
)
}
function toggleVisibilityMenu() {
visibilityMenuVisible = !visibilityMenuVisible
}