File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,7 +68,9 @@ export default function SessionMoreMenuComponent(props: {
6868 < Menu . Item
6969 onPress = { ( ) => {
7070 setExerciseEditorOpen ( true ) ;
71- setEditingExerciseBlueprint ( EmptyExerciseBlueprint ) ;
71+ setEditingExerciseBlueprint (
72+ EmptyExerciseBlueprint . with ( { name : 'New Exercise' } ) ,
73+ ) ;
7274 setMenuOpen ( false ) ;
7375 } }
7476 testID = "session-add-exercise"
Original file line number Diff line number Diff line change @@ -19,24 +19,26 @@ export class Logger {
1919 console . debug ( message , o ) ;
2020 }
2121
22+ time < T > ( type : string , action : ( ) => Promise < T > ) : Promise < T > ;
2223 time ( type : string , action : ( ) => Promise < void > ) : Promise < void > ;
2324 time ( type : string , action : ( ) => void ) : void ;
24- time ( type : string , action : ( ) => Promise < void > | void ) {
25+ time < T > ( type : string , action : ( ) => Promise < T | void > | void ) {
2526 const start = performance . now ( ) ;
2627 const result = action ( ) ;
2728 if ( typeof result === 'undefined' ) {
2829 this . info (
2930 type + ' completed in ' + ( performance . now ( ) - start ) . toFixed ( 2 ) + 'ms' ,
3031 ) ;
3132 } else {
32- return result . then ( ( ) =>
33+ return result . then ( ( x ) => {
3334 this . info (
3435 type +
3536 ' completed in ' +
3637 ( performance . now ( ) - start ) . toFixed ( 2 ) +
3738 'ms' ,
38- ) ,
39- ) ;
39+ ) ;
40+ return x ;
41+ } ) ;
4042 }
4143 }
4244}
You can’t perform that action at this time.
0 commit comments