Fix Navigator spaces display in case of multiple contributions (#1097)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2022-03-04 16:04:21 +07:00 committed by GitHub
parent 748ad4d258
commit 35b8fbe9c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,7 @@
<script lang="ts">
import core, { Ref, SortingOrder, Space } from '@anticrm/core'
import { getResource } from '@anticrm/platform'
import { createQuery } from '@anticrm/presentation'
import { createQuery, getClient } from '@anticrm/presentation'
import { Scroller } from '@anticrm/ui'
import type { NavigatorModel, SpecialNavModel } from '@anticrm/workbench'
import { createEventDispatcher } from 'svelte'
@ -29,6 +29,8 @@
export let currentSpace: Ref<Space> | undefined
export let currentSpecial: string | undefined
const client = getClient()
const hierarchy = client.getHierarchy()
const query = createQuery()
let spaces: Space[] = []
let shownSpaces: Space[] = []
@ -100,7 +102,7 @@
{#if showDivider}<TreeSeparator />{/if}
{#each model.spaces as m (m.label)}
<SpacesNav spaces={shownSpaces} {currentSpace} model={m} on:space/>
<SpacesNav spaces={shownSpaces.filter(it => hierarchy.isDerived(it._class, m.spaceClass))} {currentSpace} model={m} on:space/>
{/each}
{#if model.specials}
{#each bottomSpecials as special}