fix: fixes issue where Moments camera wouldn't properly start on desktop app (#2084)

This commit is contained in:
Mo
2022-12-02 11:05:32 -06:00
committed by GitHub
parent c8c166d2a0
commit 8c41f0ecc3
10 changed files with 59 additions and 0 deletions

View File

@@ -86,6 +86,20 @@ export class MomentsService extends AbstractViewController {
message: 'Capturing Moment...',
})
if (this.application.desktopDevice) {
const granted = await this.application.desktopDevice.askForMediaAccess('camera')
if (!granted) {
dismissToast(toastId)
addToast({
type: ToastType.Error,
message: 'Please enable Camera permissions for Standard Notes to enable Moments.',
duration: 3000,
})
return
}
}
const { canvas, video, stream, width, height } = await preparePhotoOperation()
const filename = `Moment ${dateToStringStyle1(new Date())}.png`