File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -178,13 +178,15 @@ export class AttachmentQueue {
178178 fileExtension,
179179 mediaType,
180180 metaData,
181- id
181+ id,
182+ updateHook
182183 } : {
183184 data : ArrayBuffer | Blob | string ;
184185 fileExtension : string ;
185186 mediaType ?: string ;
186187 metaData ?: string ;
187188 id ?: string ;
189+ updateHook ?: ( transaction : Transaction , attachment : AttachmentRecord ) => void ;
188190 } ) : Promise < AttachmentRecord > {
189191 const resolvedId = id ?? ( await this . context . db . get < { id : string } > ( 'SELECT uuid() as id' ) ) . id ;
190192 const filename = `${ resolvedId } .${ fileExtension } ` ;
@@ -204,6 +206,7 @@ export class AttachmentQueue {
204206 } ;
205207
206208 await this . context . db . writeTransaction ( async ( tx ) => {
209+ updateHook ?.( tx , attachment ) ;
207210 this . context . upsertAttachment ( attachment , tx ) ;
208211 } ) ;
209212
You can’t perform that action at this time.
0 commit comments