Added attachment support
This commit is contained in:
@@ -1,11 +1,21 @@
|
||||
import {signal} from '@angular/core';
|
||||
import {FileData} from '@chatenium/chatenium-sdk/domain/fileUploadService.schema';
|
||||
import {FileDataWithPreview} from './message-box';
|
||||
|
||||
export class MessageBoxViewModel {
|
||||
onMessageSend: (message: string) => void
|
||||
onMessageSend: (message: string, files: FileDataWithPreview[] | null) => void
|
||||
|
||||
constructor(onMessageSend: (message: string) => void) {
|
||||
constructor(onMessageSend: (message: string, files: FileDataWithPreview[] | null) => void) {
|
||||
this.onMessageSend = onMessageSend
|
||||
}
|
||||
|
||||
message = signal<string>("")
|
||||
files = signal<FileDataWithPreview[]>([])
|
||||
|
||||
get dialogOpen() {
|
||||
return this.files().length != 0
|
||||
}
|
||||
set dialogOpen(value: boolean) {
|
||||
this.files.set([])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user