Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2023-06-07 18:52:04 +06:00 committed by GitHub
parent aa09fa62c9
commit a4a756d3c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 25 deletions

View File

@ -14,7 +14,7 @@
-->
<script lang="ts">
import { Ref, Space } from '@hcengineering/core'
import { MultipleDraftController, getClient } from '@hcengineering/presentation'
import { MultipleDraftController } from '@hcengineering/presentation'
import { Button, IconAdd, showPopup } from '@hcengineering/ui'
import { onDestroy } from 'svelte'
import tracker from '../plugin'
@ -22,11 +22,7 @@
export let currentSpace: Ref<Space> | undefined
const client = getClient()
let space: Ref<Space> | undefined
let closed = true
$: updateSpace(currentSpace)
let draftExists = false
@ -36,24 +32,9 @@
draftExists = res
})
)
async function updateSpace (spaceId: Ref<Space> | undefined): Promise<void> {
if (spaceId !== undefined) {
space = spaceId
return
}
const project = await client.findOne(tracker.class.Project, {})
space = project?._id
}
async function newIssue (): Promise<void> {
if (!space) {
const project = await client.findOne(tracker.class.Project, {})
space = project?._id
}
closed = false
showPopup(CreateIssue, { space, shouldSaveDraft: true }, 'top', () => {
showPopup(CreateIssue, { space: currentSpace, shouldSaveDraft: true }, 'top', () => {
closed = true
})
}

View File

@ -500,13 +500,13 @@
onMount(() => subscribeMobile(setTheme))
async function checkIsHeaderHidden () {
async function checkIsHeaderHidden (currentApplication: Application | undefined) {
return (
currentApplication?.checkIsHeaderHidden && (await (await getResource(currentApplication.checkIsHeaderHidden))())
)
}
async function checkIsHeaderDisabled () {
async function checkIsHeaderDisabled (currentApplication: Application | undefined) {
return (
currentApplication?.checkIsHeaderDisabled &&
(await (
@ -644,9 +644,9 @@
{#if currentApplication}
<NavHeader label={currentApplication.label} />
{#if currentApplication.navHeaderComponent}
{#await checkIsHeaderHidden() then isHidden}
{#await checkIsHeaderHidden(currentApplication) then isHidden}
{#if !isHidden}
{#await checkIsHeaderDisabled() then disabled}
{#await checkIsHeaderDisabled(currentApplication) then disabled}
<Component is={currentApplication.navHeaderComponent} props={{ currentSpace, disabled }} shrink />
{/await}
{/if}