refactor: separate selectAndUploadFile and uploadFile functions (#2085)

This commit is contained in:
Aman Harwara
2022-12-04 11:11:37 +05:30
committed by GitHub
parent 2175c9cdcb
commit 90e10c76f7
9 changed files with 108 additions and 113 deletions

View File

@@ -80,7 +80,7 @@ export class MomentsService extends AbstractViewController {
}
}
public async takePhoto(): Promise<FileItem[] | undefined> {
public async takePhoto(): Promise<FileItem | undefined> {
const toastId = addToast({
type: ToastType.Loading,
message: 'Capturing Moment...',
@@ -123,7 +123,7 @@ export class MomentsService extends AbstractViewController {
const defaultTag = this.getDefaultTag()
if (defaultTag && uploadedFile) {
void this.application.linkingController.linkItems(uploadedFile[0], defaultTag)
void this.application.linkingController.linkItems(uploadedFile, defaultTag)
}
stopCameraStream(canvas, video, stream)