UBER-880 Use space presenter for starred spaces (#3717)

Signed-off-by: Alexander Onnikov <alexander.onnikov@xored.com>
This commit is contained in:
Alexander Onnikov
2023-09-20 00:21:22 +07:00
committed by GitHub
parent 7e0fe4e91f
commit fd5436536d
4 changed files with 53 additions and 31 deletions
+12 -1
View File
@@ -1,6 +1,6 @@
//
// Copyright © 2020, 2021 Anticrm Platform Contributors.
// Copyright © 2021 Hardcore Engineering Inc.
// Copyright © 2021, 2023 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
@@ -22,6 +22,7 @@ import { getResource, setMetadata } from '@hcengineering/platform'
import preference from '@hcengineering/preference'
import { closeClient, getClient } from '@hcengineering/presentation'
import {
AnySvelteComponent,
closePanel,
fetchMetadataLocalStorage,
getCurrentLocation,
@@ -205,3 +206,13 @@ export function signOut (): void {
void closeClient()
navigate({ path: [loginId] })
}
export async function getSpacePresenter (
client: Client,
_class: Ref<Class<Doc>>
): Promise<AnySvelteComponent | undefined> {
const value = client.getHierarchy().classHierarchyMixin(_class, view.mixin.SpacePresenter)
if (value?.presenter !== undefined) {
return await getResource(value.presenter)
}
}