mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-10 03:37:43 +02:00
fix: properly update pulse typing sub (#9875)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
@@ -295,6 +295,7 @@ export async function configurePlatform (onWorkbenchConnect?: () => Promise<void
|
||||
setMetadata(presentation.metadata.MailUrl, config.MAIL_URL)
|
||||
setMetadata(recorder.metadata.StreamUrl, config.STREAM_URL ?? '')
|
||||
setMetadata(presentation.metadata.StatsUrl, config.STATS_URL)
|
||||
setMetadata(presentation.metadata.PulseUrl, config.PULSE_URL ?? '')
|
||||
|
||||
setMetadata(textEditor.metadata.Collaborator, config.COLLABORATOR ?? '')
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ export interface Config {
|
||||
MAIL_URL?: string
|
||||
COMMUNICATION_API_ENABLED?: string
|
||||
BILLING_URL?: string
|
||||
PULSE_URL?: string
|
||||
PASSWORD_STRICTNESS?: 'very_strict' | 'strict' | 'normal' | 'none'
|
||||
EXCLUDED_APPLICATIONS_FOR_ANONYMOUS?: string
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { onDestroy, onMount } from 'svelte'
|
||||
import { onDestroy } from 'svelte'
|
||||
import chunter from '@hcengineering/chunter'
|
||||
import { getName, getCurrentEmployee, Person } from '@hcengineering/contact'
|
||||
import { getPersonsByPersonRefs } from '@hcengineering/contact-resources'
|
||||
@@ -62,9 +62,12 @@
|
||||
|
||||
let unsubscribe: (() => Promise<boolean>) | undefined
|
||||
|
||||
onMount(async () => {
|
||||
unsubscribe = await subscribeTyping(object._id, handleTypingInfo)
|
||||
})
|
||||
async function updateTypingSub (objectId: Ref<Doc>): Promise<void> {
|
||||
await unsubscribe?.()
|
||||
unsubscribe = await subscribeTyping(objectId, handleTypingInfo)
|
||||
}
|
||||
|
||||
$: void updateTypingSub(object._id)
|
||||
|
||||
onDestroy(() => {
|
||||
void unsubscribe?.()
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<!-- See the License for the specific language governing permissions and -->
|
||||
<!-- limitations under the License. -->
|
||||
<script lang="ts">
|
||||
import { onDestroy, onMount } from 'svelte'
|
||||
import { onDestroy } from 'svelte'
|
||||
import { getName, getCurrentEmployee, Person } from '@hcengineering/contact'
|
||||
import { getPersonsByPersonRefs } from '@hcengineering/contact-resources'
|
||||
import { Ref } from '@hcengineering/core'
|
||||
@@ -62,9 +62,12 @@
|
||||
|
||||
let unsubscribe: (() => Promise<boolean>) | undefined
|
||||
|
||||
onMount(async () => {
|
||||
async function updateTypingSub (cardId: CardID): Promise<void> {
|
||||
await unsubscribe?.()
|
||||
unsubscribe = await subscribeTyping(cardId, handleTypingInfo)
|
||||
})
|
||||
}
|
||||
|
||||
$: void updateTypingSub(cardId)
|
||||
|
||||
onDestroy(() => {
|
||||
void unsubscribe?.()
|
||||
|
||||
Reference in New Issue
Block a user