mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Skip opening root document if delete originated from a file-restore (#27992)
* Skip opening root document if delete originated from a file-restore * handle project-restore origin * Refactor isFileRestore logic GitOrigin-RevId: f2a34189140deb4e614d93e8d197b8a6a90c8f65
This commit is contained in:
committed by
Copybot
parent
fa9cea9f1d
commit
dff92f1e6b
@@ -121,10 +121,10 @@ export const FileTreeOpenProvider: FC<React.PropsWithChildren> = ({
|
||||
)
|
||||
|
||||
const handleFileTreeDelete = useCallback(
|
||||
(entity: FileTreeFindResult) => {
|
||||
(entity: FileTreeFindResult, isFileRestore?: boolean) => {
|
||||
eventEmitter.emit('entity:deleted', entity)
|
||||
// Select the root document if the current document was deleted
|
||||
if (entity.entity._id === currentDocumentId) {
|
||||
// Select the root document if the current document was deleted and delete is not part of a file restore
|
||||
if (!isFileRestore && entity.entity._id === currentDocumentId) {
|
||||
openDocWithId(rootDocId!)
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user