fix: subscription works correctly again
This commit is contained in:
parent
17a42dc2e7
commit
89c81ae854
4 changed files with 6 additions and 10 deletions
|
@ -56,12 +56,11 @@
|
|||
{{ $t('menu.archive') }}
|
||||
</dropdown-item>
|
||||
<task-subscription
|
||||
v-if="subscription"
|
||||
class="dropdown-item has-no-shadow"
|
||||
:is-button="false"
|
||||
entity="list"
|
||||
:entity-id="list.id"
|
||||
:subscription="subscription"
|
||||
:subscription="list.subscription"
|
||||
@change="sub => subscription = sub"
|
||||
/>
|
||||
<dropdown-item
|
||||
|
@ -93,11 +92,9 @@ const props = defineProps({
|
|||
},
|
||||
})
|
||||
|
||||
const subscription = ref<SubscriptionModel>()
|
||||
const subscription = ref<SubscriptionModel | null>(null)
|
||||
watchEffect(() => {
|
||||
if (props.list.subscription) {
|
||||
subscription.value = props.list.subscription
|
||||
}
|
||||
subscription.value = props.list.subscription ?? null
|
||||
})
|
||||
|
||||
const store = useStore()
|
||||
|
|
|
@ -36,15 +36,16 @@ import {success} from '@/message'
|
|||
interface Props {
|
||||
entity: string
|
||||
entityId: number
|
||||
subscription: SubscriptionModel
|
||||
subscription: SubscriptionModel | null
|
||||
isButton?: boolean
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
isButton: true,
|
||||
subscription: null,
|
||||
})
|
||||
|
||||
const subscriptionEntity = computed<string>(() => props.subscription.entity)
|
||||
const subscriptionEntity = computed<string | null>(() => props.subscription?.entity ?? null)
|
||||
|
||||
const emit = defineEmits(['change'])
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
{{ $t('menu.archive') }}
|
||||
</dropdown-item>
|
||||
<task-subscription
|
||||
v-if="subscription"
|
||||
class="dropdown-item has-no-shadow"
|
||||
:is-button="false"
|
||||
entity="namespace"
|
||||
|
|
|
@ -264,7 +264,6 @@
|
|||
{{ task.done ? $t('task.detail.undone') : $t('task.detail.done') }}
|
||||
</x-button>
|
||||
<task-subscription
|
||||
v-if="task.subscription"
|
||||
entity="task"
|
||||
:entity-id="task.id"
|
||||
:subscription="task.subscription"
|
||||
|
|
Loading…
Reference in a new issue