Disable visibility menu in reply if parent post is not public
This commit is contained in:
parent
36a028e9f3
commit
b0f7042008
2 changed files with 12 additions and 0 deletions
|
@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Restore payment details when navigating back to subscription payment page from another page.
|
- 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
|
## [1.12.0] - 2023-01-26
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,7 @@
|
||||||
v-click-away="hideVisibilityMenu"
|
v-click-away="hideVisibilityMenu"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
|
v-if="canChangeVisibility()"
|
||||||
type="button"
|
type="button"
|
||||||
class="icon"
|
class="icon"
|
||||||
title="Change visibility"
|
title="Change visibility"
|
||||||
|
@ -69,6 +70,9 @@
|
||||||
>
|
>
|
||||||
<visibility-icon :visibility="visibility"></visibility-icon>
|
<visibility-icon :visibility="visibility"></visibility-icon>
|
||||||
</button>
|
</button>
|
||||||
|
<span v-else class="icon">
|
||||||
|
<visibility-icon :visibility="visibility"></visibility-icon>
|
||||||
|
</span>
|
||||||
<menu v-if="visibilityMenuVisible" class="dropdown-menu">
|
<menu v-if="visibilityMenuVisible" class="dropdown-menu">
|
||||||
<li v-for="[value, display] in visibilityMap" :key="value">
|
<li v-for="[value, display] in visibilityMap" :key="value">
|
||||||
<button
|
<button
|
||||||
|
@ -268,6 +272,13 @@ function removeAttachment(index: number) {
|
||||||
attachments.splice(index, 1)
|
attachments.splice(index, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function canChangeVisibility(): boolean {
|
||||||
|
return (
|
||||||
|
props.inReplyTo === null ||
|
||||||
|
props.inReplyTo.visibility === Visibility.Public
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
function toggleVisibilityMenu() {
|
function toggleVisibilityMenu() {
|
||||||
visibilityMenuVisible = !visibilityMenuVisible
|
visibilityMenuVisible = !visibilityMenuVisible
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue