Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion plugins/love-resources/src/invites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.
//

import { type Ref } from '@hcengineering/core'
import { AccountRole, getCurrentAccount, type Ref } from '@hcengineering/core'
import { getCurrentEmployee, type Person } from '@hcengineering/contact'
import { type PopupResult, showPopup } from '@hcengineering/ui'
import { type UnsubscribeCallback } from '@hcengineering/hulypulse-client'
Expand Down Expand Up @@ -68,6 +68,7 @@ export async function unsubscribeInviteResponses (): Promise<void> {
}

export function sendInvites (persons: Array<Ref<Person>>): void {
if (getCurrentAccount().role === AccountRole.ReadOnlyGuest) return
closeInvitesPopup()
requestPersons = persons
const myParticipation = get(myInfo)
Expand All @@ -86,6 +87,7 @@ export function closeInvitesPopup (): void {
}

export async function updateInvites (persons: Array<Ref<Person>>, meetingId: string): Promise<void> {
if (getCurrentAccount().role === AccountRole.ReadOnlyGuest) return
const client = await createPulseClient()
const currentPerson = getCurrentEmployee()

Expand Down Expand Up @@ -143,6 +145,7 @@ let activeRequestKey: string | undefined
let activeRequestsMap: Map<string, InviteRequest | undefined>

export async function subscribeInviteRequests (): Promise<void> {
if (getCurrentAccount().role === AccountRole.ReadOnlyGuest) return
const client = await createPulseClient()
if (client === undefined) return

Expand Down
5 changes: 4 additions & 1 deletion plugins/love-resources/src/joinRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.
//

import { type Ref } from '@hcengineering/core'
import { AccountRole, getCurrentAccount, type Ref } from '@hcengineering/core'
import { getCurrentEmployee, type Person } from '@hcengineering/contact'
import { type PopupResult, showPopup } from '@hcengineering/ui'
import { type UnsubscribeCallback } from '@hcengineering/hulypulse-client'
Expand Down Expand Up @@ -65,6 +65,7 @@ export async function unsubscribeJoinResponses (): Promise<void> {
}

export function sendJoinRequest (meetingId: string): void {
if (getCurrentAccount().role === AccountRole.ReadOnlyGuest) return
closeJoinRequestPopup()
requestMeetingId = meetingId
requestPopup = showPopup(JoinRequestPopup, { meetingId }, undefined, undefined, undefined, {
Expand All @@ -80,6 +81,7 @@ export function closeJoinRequestPopup (): void {
}

export async function updateJoinRequest (): Promise<void> {
if (getCurrentAccount().role === AccountRole.ReadOnlyGuest) return
const client = await createPulseClient()
const currentPerson = getCurrentEmployee()

Expand Down Expand Up @@ -135,6 +137,7 @@ let activeRequestKey: string | undefined
let activeRequestsMap: Map<string, JoinRequest | undefined> | undefined

export async function subscribeJoinRequests (meetingId: string | undefined): Promise<void> {
if (getCurrentAccount().role === AccountRole.ReadOnlyGuest) return
if (meetingId === undefined) return

const client = await createPulseClient()
Expand Down