File tree Expand file tree Collapse file tree 4 files changed +17
-3
lines changed
Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -1163,7 +1163,7 @@ export async function start(config: Config): Promise<void> {
11631163 await processEvent ( {
11641164 type : "LOCAL_DELETE_REJECTED" ,
11651165 fileName : file . fileName ,
1166- content : file . content ?? "" ,
1166+ content : file . content ,
11671167 } )
11681168 }
11691169
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export { getPortFromHash } from "./ports.ts"
1919// Sync tracker
2020export { createSyncTracker , type SyncTracker } from "./sync-tracker.ts"
2121export type {
22+ CancelledDelete ,
2223 CliToPluginMessage ,
2324 ConflictSummary ,
2425 ConflictVersionData ,
Original file line number Diff line number Diff line change @@ -12,6 +12,12 @@ export interface PendingDelete {
1212 content ?: string
1313}
1414
15+ /** File with content to restore when delete is cancelled - content is required */
16+ export interface CancelledDelete {
17+ fileName : string
18+ content : string
19+ }
20+
1521export interface ConflictSummary {
1622 fileName : string
1723 /** null means the file was deleted on this side */
@@ -78,7 +84,7 @@ export type PluginToCliMessage =
7884 | { type : "file-change" ; fileName : string ; content : string }
7985 | { type : "file-delete" ; fileNames : string [ ] }
8086 | { type : "delete-confirmed" ; fileNames : string [ ] }
81- | { type : "delete-cancelled" ; files : PendingDelete [ ] }
87+ | { type : "delete-cancelled" ; files : CancelledDelete [ ] }
8288 | { type : "file-synced" ; fileName : string ; remoteModifiedAt : number }
8389 | {
8490 type : "conflicts-resolved"
Original file line number Diff line number Diff line change @@ -659,7 +659,14 @@ function createMessageHandler({
659659 const files : PendingDelete [ ] = [ ]
660660 for ( const fileName of message . fileNames ) {
661661 const content = await api . readCurrentContent ( fileName )
662- files . push ( { fileName, content } )
662+ // Only include files that exist in Framer (have content to restore)
663+ if ( content !== undefined ) {
664+ files . push ( { fileName, content } )
665+ }
666+ }
667+ if ( files . length === 0 ) {
668+ // No files exist in Framer, nothing to confirm
669+ break
663670 }
664671 dispatch ( {
665672 type : "pending-deletes" ,
You can’t perform that action at this time.
0 commit comments