Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2022-05-19 17:35:43 +07:00 committed by GitHub
parent 6152d55eb1
commit 59e86ce484
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 17 deletions

View File

@ -14,24 +14,21 @@
--> -->
<script lang="ts"> <script lang="ts">
import { Attachment } from '@anticrm/attachment' import { Attachment } from '@anticrm/attachment'
import contact, { Employee } from '@anticrm/contact' import contact, { Employee, EmployeeAccount } from '@anticrm/contact'
import { EmployeeAccount } from '@anticrm/contact'
import core, { Class, getCurrentAccount, Ref, Space } from '@anticrm/core' import core, { Class, getCurrentAccount, Ref, Space } from '@anticrm/core'
import view from '@anticrm/view'
import { getClient } from '@anticrm/presentation' import { getClient } from '@anticrm/presentation'
import ui, { import ui, {
EditWithIcon,
getCurrentLocation, getCurrentLocation,
location, Icon,
IconSearch, IconSearch,
Label, Label,
navigate, navigate,
EditWithIcon,
Spinner, Spinner,
Tooltip, Tooltip
Icon
} from '@anticrm/ui' } from '@anticrm/ui'
import { onDestroy } from 'svelte' import view from '@anticrm/view'
import { FileBrowserSortMode, dateFileBrowserFilters, fileTypeFileBrowserFilters, sortModeToOptionObject } from '..' import { dateFileBrowserFilters, FileBrowserSortMode, fileTypeFileBrowserFilters, sortModeToOptionObject } from '..'
import attachment from '../plugin' import attachment from '../plugin'
import AttachmentsGalleryView from './AttachmentsGalleryView.svelte' import AttachmentsGalleryView from './AttachmentsGalleryView.svelte'
import AttachmentsListView from './AttachmentsListView.svelte' import AttachmentsListView from './AttachmentsListView.svelte'
@ -41,6 +38,12 @@
const client = getClient() const client = getClient()
const loc = getCurrentLocation() const loc = getCurrentLocation()
const spaceId: Ref<Space> | undefined = loc.query?.spaceId as Ref<Space> | undefined const spaceId: Ref<Space> | undefined = loc.query?.spaceId as Ref<Space> | undefined
$: if (spaceId !== undefined) {
const loc = getCurrentLocation()
loc.query = undefined
navigate(loc)
}
export let requestedSpaceClasses: Ref<Class<Space>>[] = [] export let requestedSpaceClasses: Ref<Class<Space>>[] = []
const currentUser = getCurrentAccount() as EmployeeAccount const currentUser = getCurrentAccount() as EmployeeAccount
let selectedParticipants: Ref<Employee>[] = [currentUser.employee] let selectedParticipants: Ref<Employee>[] = [currentUser.employee]
@ -103,13 +106,6 @@
) )
isLoading = false isLoading = false
} }
onDestroy(
location.subscribe(async (loc) => {
loc.query = undefined
navigate(loc)
})
)
</script> </script>
<div class="ac-header full divide"> <div class="ac-header full divide">

View File

@ -83,7 +83,7 @@
} }
function isSelected (value: Doc, values: any[]): boolean { function isSelected (value: Doc, values: any[]): boolean {
return values.includes(value._id) return values.includes(value?._id ?? '')
} }
function checkMode () { function checkMode () {