mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-03 14:19:56 +00:00
Fix room connection after refresh (#5734)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
cbc13c7b14
commit
26271359bf
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
<div class="hulyPanels-container" class:left-divider={$screenSharing || $currentRoom?.type === RoomType.Video}>
|
<div class="hulyPanels-container" class:left-divider={$screenSharing || $currentRoom?.type === RoomType.Video}>
|
||||||
{#if ($currentRoom !== undefined && $screenSharing) || $currentRoom?.type === RoomType.Video}
|
{#if ($currentRoom !== undefined && $screenSharing) || $currentRoom?.type === RoomType.Video}
|
||||||
<RoomComponent withVideo={$currentRoom.type === RoomType.Video} room={$currentRoom._id} />
|
<RoomComponent withVideo={$currentRoom.type === RoomType.Video} room={$currentRoom} />
|
||||||
{:else}
|
{:else}
|
||||||
<Hall bind:visibleNav {navFloat} {appsDirection} />
|
<Hall bind:visibleNav {navFloat} {appsDirection} />
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Analytics } from '@hcengineering/analytics'
|
import { Analytics } from '@hcengineering/analytics'
|
||||||
import { Ref } from '@hcengineering/core'
|
import { personByIdStore } from '@hcengineering/contact-resources'
|
||||||
import { Label, Loading, deviceOptionsStore as deviceInfo } from '@hcengineering/ui'
|
|
||||||
import { Room as TypeRoom } from '@hcengineering/love'
|
import { Room as TypeRoom } from '@hcengineering/love'
|
||||||
import { getMetadata } from '@hcengineering/platform'
|
import { getMetadata } from '@hcengineering/platform'
|
||||||
|
import { Label, Loading, deviceOptionsStore as deviceInfo } from '@hcengineering/ui'
|
||||||
import {
|
import {
|
||||||
LocalParticipant,
|
LocalParticipant,
|
||||||
LocalTrackPublication,
|
LocalTrackPublication,
|
||||||
@ -31,13 +31,13 @@
|
|||||||
} from 'livekit-client'
|
} from 'livekit-client'
|
||||||
import { onDestroy, onMount, tick } from 'svelte'
|
import { onDestroy, onMount, tick } from 'svelte'
|
||||||
import love from '../plugin'
|
import love from '../plugin'
|
||||||
import { currentRoom, infos } from '../stores'
|
import { currentRoom, infos, invites, myInfo, myRequests } from '../stores'
|
||||||
import { awaitConnect, isConnected, isCurrentInstanceConnected, lk, screenSharing } from '../utils'
|
import { awaitConnect, isConnected, isCurrentInstanceConnected, lk, screenSharing, tryConnect } from '../utils'
|
||||||
import ControlBar from './ControlBar.svelte'
|
import ControlBar from './ControlBar.svelte'
|
||||||
import ParticipantView from './ParticipantView.svelte'
|
import ParticipantView from './ParticipantView.svelte'
|
||||||
|
|
||||||
export let withVideo: boolean
|
export let withVideo: boolean
|
||||||
export let room: Ref<TypeRoom>
|
export let room: TypeRoom
|
||||||
|
|
||||||
interface ParticipantData {
|
interface ParticipantData {
|
||||||
_id: string
|
_id: string
|
||||||
@ -214,6 +214,11 @@
|
|||||||
|
|
||||||
configured = true
|
configured = true
|
||||||
|
|
||||||
|
if (!$isConnected && !$isCurrentInstanceConnected) {
|
||||||
|
const info = $infos.filter((p) => p.room === room._id)
|
||||||
|
await tryConnect($personByIdStore, $myInfo, room, info, $myRequests, $invites)
|
||||||
|
}
|
||||||
|
|
||||||
await awaitConnect()
|
await awaitConnect()
|
||||||
for (const participant of lk.remoteParticipants.values()) {
|
for (const participant of lk.remoteParticipants.values()) {
|
||||||
attachParticipant(participant)
|
attachParticipant(participant)
|
||||||
@ -259,7 +264,7 @@
|
|||||||
onDestroy(
|
onDestroy(
|
||||||
infos.subscribe((data) => {
|
infos.subscribe((data) => {
|
||||||
for (const info of data) {
|
for (const info of data) {
|
||||||
if (info.room !== room) continue
|
if (info.room !== room._id) continue
|
||||||
const current = participants.find((p) => p._id === info.person)
|
const current = participants.find((p) => p._id === info.person)
|
||||||
if (current !== undefined) continue
|
if (current !== undefined) continue
|
||||||
const value: ParticipantData = {
|
const value: ParticipantData = {
|
||||||
|
Loading…
Reference in New Issue
Block a user