Fix attachments input (#6002)

This commit is contained in:
Kristina 2024-07-04 18:51:33 +04:00 committed by GitHub
parent 630ae21a66
commit 0061162d87
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 7 deletions

View File

@ -238,11 +238,9 @@ export class TInboxNotification extends TDoc implements InboxNotification {
@Model(notification.class.ActivityInboxNotification, notification.class.InboxNotification)
export class TActivityInboxNotification extends TInboxNotification implements ActivityInboxNotification {
@Prop(TypeRef(activity.class.ActivityMessage), core.string.AttachedTo)
@Index(IndexKind.Indexed)
attachedTo!: Ref<ActivityMessage>
@Prop(TypeRef(activity.class.ActivityMessage), core.string.AttachedToClass)
@Index(IndexKind.Indexed)
attachedToClass!: Ref<Class<ActivityMessage>>
}
@ -647,6 +645,15 @@ export function createModel (builder: Builder): void {
indexes: []
}
)
builder.mixin<Class<DocNotifyContext>, IndexingConfiguration<DocNotifyContext>>(
notification.class.ActivityInboxNotification,
core.class.Class,
core.mixin.IndexConfiguration,
{
searchDisabled: true,
indexes: []
}
)
}
export function generateClassNotificationTypes (

View File

@ -99,7 +99,7 @@
async function updateAttachments (objectId: Ref<Doc>): Promise<void> {
draftAttachments = $draftsStore[draftKey]
if (draftAttachments && shouldSaveDraft) {
attachments.clear()
attachments = new Map()
newAttachments.clear()
Object.entries(draftAttachments).map((file) => {
return attachments.set(file[0] as Ref<Attachment>, file[1])
@ -127,7 +127,7 @@
}
)
} else {
attachments.clear()
attachments = new Map()
newAttachments.clear()
originalAttachments.clear()
removedAttachments.clear()

View File

@ -144,10 +144,8 @@
// Remove draft from Local Storage
clear()
currentMessage = getDefault()
_id = currentMessage._id
loading = false
dispatch('submit', false)
loading = false
}
async function createMessage (event: CustomEvent, _id: Ref<ChatMessage>): Promise<void> {