mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 03:40:48 +00:00
1091 fix (#1206)
Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
parent
4188d6a32b
commit
667d22cb7a
@ -31,40 +31,24 @@
|
||||
import { ChannelsEditor } from '@anticrm/contact-resources'
|
||||
const client = getClient()
|
||||
|
||||
let account: EmployeeAccount | undefined
|
||||
let employee: Employee | undefined
|
||||
let firstName: string
|
||||
let lastName: string
|
||||
const accountQ = createQuery()
|
||||
const employeeQ = createQuery()
|
||||
$: accountQ.query(
|
||||
contact.class.EmployeeAccount,
|
||||
|
||||
employeeQ.query(
|
||||
contact.class.Employee,
|
||||
{
|
||||
_id: getCurrentAccount()._id as Ref<EmployeeAccount>
|
||||
_id: (getCurrentAccount() as EmployeeAccount).employee
|
||||
},
|
||||
(res) => {
|
||||
account = res[0]
|
||||
employee = res[0]
|
||||
firstName = getFirstName(employee.name)
|
||||
lastName = getLastName(employee.name)
|
||||
},
|
||||
{ limit: 1 }
|
||||
)
|
||||
|
||||
$: account && updateQuery(account.employee)
|
||||
|
||||
function updateQuery (id: Ref<Employee>): void {
|
||||
employeeQ.query(
|
||||
contact.class.Employee,
|
||||
{
|
||||
_id: id
|
||||
},
|
||||
(res) => {
|
||||
employee = res[0]
|
||||
firstName = getFirstName(employee.name)
|
||||
lastName = getLastName(employee.name)
|
||||
},
|
||||
{ limit: 1 }
|
||||
)
|
||||
}
|
||||
|
||||
async function onAvatarDone (e: any) {
|
||||
if (employee === undefined) return
|
||||
const uploadFile = await getResource(attachment.helper.UploadFile)
|
||||
|
@ -27,7 +27,7 @@
|
||||
import Connect from './Connect.svelte'
|
||||
import TelegramIcon from './icons/Telegram.svelte'
|
||||
import Messages from './Messages.svelte'
|
||||
import Reconnect from './Reconnect.svelte';
|
||||
import Reconnect from './Reconnect.svelte'
|
||||
|
||||
export let object: Contact
|
||||
let channel: Channel | undefined = undefined
|
||||
|
@ -26,17 +26,11 @@
|
||||
return await client.findAll(setting.class.SettingsCategory, {}, { sort: { order: 1 } })
|
||||
}
|
||||
|
||||
let account: EmployeeAccount | undefined
|
||||
const account = getCurrentAccount() as EmployeeAccount
|
||||
let employee: Employee | undefined
|
||||
const accountQ = createQuery()
|
||||
const employeeQ = createQuery()
|
||||
$: accountQ.query(contact.class.EmployeeAccount, {
|
||||
_id: getCurrentAccount()._id as Ref<EmployeeAccount>
|
||||
}, (res) => {
|
||||
account = res[0]
|
||||
}, { limit: 1 })
|
||||
|
||||
$: account && employeeQ.query(contact.class.Employee, {
|
||||
employeeQ.query(contact.class.Employee, {
|
||||
_id: account.employee
|
||||
}, (res) => {
|
||||
employee = res[0]
|
||||
|
@ -151,33 +151,21 @@
|
||||
visibileNav = !visibileNav
|
||||
closeTooltip()
|
||||
}
|
||||
let account: EmployeeAccount | undefined
|
||||
const account = getCurrentAccount() as EmployeeAccount
|
||||
let employee: Employee | undefined
|
||||
const accountQ = createQuery()
|
||||
const employeeQ = createQuery()
|
||||
$: accountQ.query(
|
||||
contact.class.EmployeeAccount,
|
||||
|
||||
employeeQ.query(
|
||||
contact.class.Employee,
|
||||
{
|
||||
_id: getCurrentAccount()._id as Ref<EmployeeAccount>
|
||||
_id: account.employee
|
||||
},
|
||||
(res) => {
|
||||
account = res[0]
|
||||
employee = res[0]
|
||||
},
|
||||
{ limit: 1 }
|
||||
)
|
||||
|
||||
$: account &&
|
||||
employeeQ.query(
|
||||
contact.class.Employee,
|
||||
{
|
||||
_id: account.employee
|
||||
},
|
||||
(res) => {
|
||||
employee = res[0]
|
||||
},
|
||||
{ limit: 1 }
|
||||
)
|
||||
|
||||
let isNavigate: boolean = false
|
||||
$: isNavigate = !!navigatorModel
|
||||
|
||||
@ -210,7 +198,7 @@
|
||||
$: notificationQuery.query(
|
||||
notification.class.Notification,
|
||||
{
|
||||
attachedTo: (getCurrentAccount() as EmployeeAccount).employee,
|
||||
attachedTo: account.employee,
|
||||
status: NotificationStatus.New
|
||||
},
|
||||
(res) => {
|
||||
|
Loading…
Reference in New Issue
Block a user