@@ -61,16 +61,21 @@ export const prepare_files_from_original_states = async (params: {
6161 new_content : new_content_for_diff
6262 } )
6363 const is_deleted =
64- state . is_deleted ||
65- ( ! state . is_new && current_content == '' && state . content != '' )
64+ state . file_state == 'deleted' ||
65+ ( state . file_state != 'new' &&
66+ current_content == '' &&
67+ state . content != '' )
6668
6769 const reviewable_file : ReviewableFile = {
6870 type : 'file' ,
6971 file_path : state . file_path ,
7072 content : current_content ,
7173 workspace_name : state . workspace_name ,
72- is_new : state . is_new || ! ! state . file_path_to_restore ,
73- is_deleted,
74+ file_state : is_deleted
75+ ? 'deleted'
76+ : state . file_state == 'new' || ! ! state . file_path_to_restore
77+ ? 'new'
78+ : undefined ,
7479 lines_added : diff_stats . lines_added ,
7580 lines_removed : diff_stats . lines_removed ,
7681 is_replaced : state . is_replaced ,
@@ -83,7 +88,7 @@ export const prepare_files_from_original_states = async (params: {
8388 sanitized_path : sanitized_file_path ,
8489 original_content : state . content ,
8590 temp_file_path,
86- file_exists : ! state . is_new
91+ file_exists : state . file_state !== 'new'
8792 } )
8893
8994 if ( state . file_path_to_restore ) {
@@ -117,8 +122,7 @@ export const prepare_files_from_original_states = async (params: {
117122 file_path : state . file_path_to_restore ,
118123 content : restored_current_content ,
119124 workspace_name : state . workspace_name ,
120- is_new : false ,
121- is_deleted : true ,
125+ file_state : 'deleted' ,
122126 lines_added : restored_diff_stats . lines_added ,
123127 lines_removed : restored_diff_stats . lines_removed ,
124128 is_checked : state . is_checked ?? true
0 commit comments