mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-28 04:25:03 +02:00
Init poll applet (#9586)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { getClient as getAccountClient } from '@hcengineering/account-client'
|
||||
import { Analytics } from '@hcengineering/analytics'
|
||||
import client from '@hcengineering/client'
|
||||
import { ensureEmployee, setCurrentEmployee } from '@hcengineering/contact'
|
||||
import contact, { ensureEmployee, setCurrentEmployee, setCurrentEmployeeSpace } from '@hcengineering/contact'
|
||||
import core, {
|
||||
type Account,
|
||||
AccountRole,
|
||||
@@ -385,7 +385,15 @@ export async function connect (title: string): Promise<Client | undefined> {
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const space = await newClient.findOne(contact.class.PersonSpace, { person: employee }, { projection: { _id: 1 } })
|
||||
|
||||
setCurrentEmployee(employee)
|
||||
if (space !== undefined) {
|
||||
setCurrentEmployeeSpace(space._id)
|
||||
} else {
|
||||
console.error('Failed to find space for employee')
|
||||
}
|
||||
await setPlatformStatus(OK)
|
||||
} else {
|
||||
setCurrentEmployee(core.employee.System)
|
||||
|
||||
Reference in New Issue
Block a user