mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-28 04:25:03 +02:00
Direct typing and presence (#10147)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
import communication from '../plugin'
|
||||
|
||||
export let cardId: CardID
|
||||
export let peerId: string | undefined
|
||||
|
||||
const maxTypingPersons = 3
|
||||
const acc = getCurrentAccount()
|
||||
@@ -40,6 +41,8 @@
|
||||
let typingInfo = new Map<string, TypingInfo>()
|
||||
let typingGroups: TypingGroup[] = []
|
||||
|
||||
$: objectId = peerId ? `peer${peerId}` : cardId
|
||||
|
||||
$: void updateTypingPersons(typingInfo)
|
||||
|
||||
async function updateTypingPersons (typingInfo: Map<string, TypingInfo>): Promise<void> {
|
||||
@@ -91,7 +94,7 @@
|
||||
class="root h-4 mt-1 mb-1 ml-0-5 overflow-label"
|
||||
use:typing={{
|
||||
socialId: acc.primarySocialId,
|
||||
objectId: cardId,
|
||||
objectId,
|
||||
onTyping: handleTyping
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -461,7 +461,7 @@
|
||||
if (message !== undefined) return
|
||||
if (!isEmptyMarkup(draft.content)) {
|
||||
throttle.call(() => {
|
||||
void setTyping(acc.primarySocialId, card._id)
|
||||
void setTyping(acc.primarySocialId, card.peerId ? `peer:${card.peerId}` : card._id)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -705,7 +705,7 @@
|
||||
</div>
|
||||
|
||||
{#if message === undefined}
|
||||
<TypingPresenter cardId={card._id} />
|
||||
<TypingPresenter cardId={card._id} peerId={card.peerId} />
|
||||
{/if}
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user