- {#if attachments?.length}
+ {#if visibleAttachments?.length}
- {#each attachments as attachment, i}
+ {#each visibleAttachments as attachment, i}
{/each}
- {#if attachmentsLimit && attachments.length === attachmentsLimit}
+ {#if attachmentsLimit && visibleAttachments.length < totalAttachments}
{
diff --git a/plugins/chunter-resources/src/components/EditChannelDescriptionTab.svelte b/plugins/chunter-resources/src/components/EditChannelDescriptionTab.svelte
index 718a2e4412..b6ef0e1305 100644
--- a/plugins/chunter-resources/src/components/EditChannelDescriptionTab.svelte
+++ b/plugins/chunter-resources/src/components/EditChannelDescriptionTab.svelte
@@ -82,6 +82,6 @@
focus
on:change={onDescriptionChange}
/>
-
+
{/if}
diff --git a/plugins/chunter-resources/src/components/Message.svelte b/plugins/chunter-resources/src/components/Message.svelte
index ebb18edbfe..12a897d074 100644
--- a/plugins/chunter-resources/src/components/Message.svelte
+++ b/plugins/chunter-resources/src/components/Message.svelte
@@ -25,7 +25,7 @@
import { Action } from '@anticrm/view'
import { getActions } from '@anticrm/view-resources'
import { createEventDispatcher } from 'svelte'
- import { UnpinMessage } from '../index';
+ import { UnpinMessage } from '../index'
import chunter from '../plugin'
import { getTime } from '../utils'
// import Share from './icons/Share.svelte'
@@ -71,17 +71,17 @@
action: chunter.actionImpl.PinMessage
} as Action)
- $: isEditing = false;
+ $: isEditing = false
const editAction = {
label: chunter.string.EditMessage,
- action: () => isEditing = true
+ action: () => (isEditing = true)
}
const deleteAction = {
label: chunter.string.DeleteMessage,
action: async () => {
- (await client.findAll(chunter.class.ThreadMessage, { attachedTo: message._id as Ref
})).forEach(c => {
+ ;(await client.findAll(chunter.class.ThreadMessage, { attachedTo: message._id as Ref })).forEach((c) => {
UnpinMessage(c)
})
UnpinMessage(message)
@@ -123,13 +123,10 @@
const { message: newContent, attachments: newAttachments } = event.detail
if (newContent !== message.content || newAttachments !== attachments) {
- await client.update(
- message,
- {
- content: newContent,
- attachments: newAttachments
- }
- )
+ await client.update(message, {
+ content: newContent,
+ attachments: newAttachments
+ })
}
isEditing = false
}
@@ -157,12 +154,12 @@
{getTime(message.createOn)}
{#if isEditing}
-
{:else}
diff --git a/plugins/chunter-resources/src/components/PinnedMessagesPopup.svelte b/plugins/chunter-resources/src/components/PinnedMessagesPopup.svelte
index 02e1df6138..c579b10cec 100644
--- a/plugins/chunter-resources/src/components/PinnedMessagesPopup.svelte
+++ b/plugins/chunter-resources/src/components/PinnedMessagesPopup.svelte
@@ -63,8 +63,7 @@
{
- if (pinnedIds.length === 1)
- dispatch('close')
+ if (pinnedIds.length === 1) dispatch('close')
UnpinMessage(message)
}}
>
diff --git a/plugins/chunter-resources/src/components/Thread.svelte b/plugins/chunter-resources/src/components/Thread.svelte
index eaf08bdc63..59012fee83 100644
--- a/plugins/chunter-resources/src/components/Thread.svelte
+++ b/plugins/chunter-resources/src/components/Thread.svelte
@@ -105,13 +105,19 @@
))
)
- async function getParticipants (comments: ThreadMessage[], parent: Message | undefined, employees: Map
[, Employee>): Promise {
+ async function getParticipants (
+ comments: ThreadMessage[],
+ parent: Message | undefined,
+ employees: Map][, Employee>
+ ): Promise {
const refs = new Set(comments.map((p) => p.createBy))
if (parent !== undefined) {
refs.add(parent.createBy)
}
refs.delete(getCurrentAccount()._id)
- const accounts = await client.findAll(contact.class.EmployeeAccount, { _id: { $in: Array.from(refs) as Ref[] } })
+ const accounts = await client.findAll(contact.class.EmployeeAccount, {
+ _id: { $in: Array.from(refs) as Ref[] }
+ })
const res: string[] = []
for (const account of accounts) {
const employee = employees.get(account.employee)
@@ -174,13 +180,25 @@
{#if parent}
{#if total > comments.length}
- ] { showAll = true }}>
+ {
+ showAll = true
+ }}
+ >
+
+
{/if}
{#each comments as comment (comment._id)}
{/each}
{/if}
diff --git a/plugins/chunter-resources/src/components/ThreadView.svelte b/plugins/chunter-resources/src/components/ThreadView.svelte
index 79b9d17f16..8af0d4eedf 100644
--- a/plugins/chunter-resources/src/components/ThreadView.svelte
+++ b/plugins/chunter-resources/src/components/ThreadView.svelte
@@ -15,7 +15,7 @@
{#each threads as thread (thread)}
-
+
{/each}