fix(subscription): don't remove every namespace but the one subscribing to
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kolaente 2022-10-24 18:56:50 +02:00
parent eae555475d
commit f17bbeddec
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 11 additions and 6 deletions

View File

@ -79,11 +79,9 @@ onMounted(() => {
function setSubscriptionInStore(sub: ISubscription) {
subscription.value = sub
namespaceStore.setNamespaces([
{
...props.namespace,
subscription: sub,
},
])
namespaceStore.setNamespaceById({
...props.namespace,
subscription: sub,
})
}
</script>

View File

@ -84,6 +84,13 @@ export const useNamespaceStore = defineStore('namespace', {
if (!namespace.lists || namespace.lists.length === 0) {
namespace.lists = this.namespaces[namespaceIndex].lists
}
// Check for each list in that namespace if it has a subscription and set it if not
namespace.lists.forEach(l => {
if (l.subscription === null || l.subscription.entity !== 'list') {
l.subscription = namespace.subscription
}
})
this.namespaces[namespaceIndex] = namespace
update(namespace)