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') }}
|
{{ $t('menu.archive') }}
|
||||||
</dropdown-item>
|
</dropdown-item>
|
||||||
<task-subscription
|
<task-subscription
|
||||||
v-if="subscription"
|
|
||||||
class="dropdown-item has-no-shadow"
|
class="dropdown-item has-no-shadow"
|
||||||
:is-button="false"
|
:is-button="false"
|
||||||
entity="list"
|
entity="list"
|
||||||
:entity-id="list.id"
|
:entity-id="list.id"
|
||||||
:subscription="subscription"
|
:subscription="list.subscription"
|
||||||
@change="sub => subscription = sub"
|
@change="sub => subscription = sub"
|
||||||
/>
|
/>
|
||||||
<dropdown-item
|
<dropdown-item
|
||||||
|
@ -93,11 +92,9 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const subscription = ref<SubscriptionModel>()
|
const subscription = ref<SubscriptionModel | null>(null)
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
if (props.list.subscription) {
|
subscription.value = props.list.subscription ?? null
|
||||||
subscription.value = props.list.subscription
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
|
|
@ -36,15 +36,16 @@ import {success} from '@/message'
|
||||||
interface Props {
|
interface Props {
|
||||||
entity: string
|
entity: string
|
||||||
entityId: number
|
entityId: number
|
||||||
subscription: SubscriptionModel
|
subscription: SubscriptionModel | null
|
||||||
isButton?: boolean
|
isButton?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
isButton: true,
|
isButton: true,
|
||||||
|
subscription: null,
|
||||||
})
|
})
|
||||||
|
|
||||||
const subscriptionEntity = computed<string>(() => props.subscription.entity)
|
const subscriptionEntity = computed<string | null>(() => props.subscription?.entity ?? null)
|
||||||
|
|
||||||
const emit = defineEmits(['change'])
|
const emit = defineEmits(['change'])
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
{{ $t('menu.archive') }}
|
{{ $t('menu.archive') }}
|
||||||
</dropdown-item>
|
</dropdown-item>
|
||||||
<task-subscription
|
<task-subscription
|
||||||
v-if="subscription"
|
|
||||||
class="dropdown-item has-no-shadow"
|
class="dropdown-item has-no-shadow"
|
||||||
:is-button="false"
|
:is-button="false"
|
||||||
entity="namespace"
|
entity="namespace"
|
||||||
|
|
|
@ -264,7 +264,6 @@
|
||||||
{{ task.done ? $t('task.detail.undone') : $t('task.detail.done') }}
|
{{ task.done ? $t('task.detail.undone') : $t('task.detail.done') }}
|
||||||
</x-button>
|
</x-button>
|
||||||
<task-subscription
|
<task-subscription
|
||||||
v-if="task.subscription"
|
|
||||||
entity="task"
|
entity="task"
|
||||||
:entity-id="task.id"
|
:entity-id="task.id"
|
||||||
:subscription="task.subscription"
|
:subscription="task.subscription"
|
||||||
|
|
Loading…
Reference in a new issue