@@ -358,7 +358,7 @@ pub fn write_session_file_from_pomodoro(
358358}
359359
360360pub fn write_session_file ( session : & Session , session_file : PathBuf ) -> io:: Result < PathBuf > {
361- eprintln ! ( "[rust] creating {:?}" , session_file) ;
361+ eprintln ! ( "[rust] writing session file {:?}" , session_file) ;
362362 fs:: create_dir_all ( session_file. clone ( ) . parent ( ) . unwrap ( ) ) ?;
363363 File :: create ( session_file. clone ( ) ) ?;
364364 fs:: write ( & session_file, format ! ( "{}" , session) ) ?;
@@ -461,7 +461,7 @@ pub fn tick_with_file_session_info(
461461) -> Result < Pomodoro > {
462462 let mut new_pomodoro = pomodoro. clone ( ) ;
463463
464- match session_info {
464+ let pomodoro_result = match session_info {
465465 // We have some session info from the disk
466466 Some ( info) => {
467467 // @TODO: Here we need to check the consistency between the session_info that we have (coming from
@@ -528,7 +528,14 @@ pub fn tick_with_file_session_info(
528528 // File is not present on disk, it may have been deleted
529529 // so we should reset the current round
530530 None => reset_round ( pomodoro) ,
531- }
531+ } ?;
532+
533+ write_session_file_from_pomodoro (
534+ & pomodoro_result,
535+ pomodoro_result. current_session . session_type ,
536+ pomodoro_result. current_session . status ,
537+ ) ?;
538+ Ok ( pomodoro_result)
532539}
533540
534541pub fn is_end_of_session ( pomodoro : & Pomodoro ) -> bool {
0 commit comments