Init poll applet (#9586)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina
2025-07-23 19:05:48 +07:00
committed by GitHub
parent fed9ef4e5a
commit 679a3df09f
56 changed files with 2500 additions and 307 deletions
+9 -1
View File
@@ -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)