File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -65,14 +65,10 @@ class ExampleMentraOSApp extends AppServer {
6565 // the user pressed the button, so we take a single photo
6666 try {
6767 // first, get the photo
68- const photoRequest = session . camera . requestPhoto ( ) ;
68+ const photo = await session . camera . requestPhoto ( ) ;
6969 // if there was an error, log it
70- photoRequest . catch ( ( error ) => this . logger . error ( `Error taking photo: ${ error } ` ) ) ;
71- // if there was no error, cache the photo for display
72- photoRequest . then ( ( photo ) => {
73- this . logger . info ( `Photo taken for user ${ userId } , timestamp: ${ photo . timestamp } ` ) ;
74- this . cachePhoto ( photo , userId ) ;
75- } ) ;
70+ this . logger . info ( `Photo taken for user ${ userId } , timestamp: ${ photo . timestamp } ` ) ;
71+ this . cachePhoto ( photo , userId ) ;
7672 } catch ( error ) {
7773 this . logger . error ( `Error taking photo: ${ error } ` ) ;
7874 }
You can’t perform that action at this time.
0 commit comments