fragment: dry
This commit is contained in:
parent
493b47a259
commit
f3666f5acf
1 changed files with 11 additions and 8 deletions
|
|
@ -21,11 +21,7 @@ class FragmentManager {
|
|||
then(result)
|
||||
}, (error)=>{
|
||||
ipc.send('errorLog', `Could not open fragment file:\n ${error}`, clientId)
|
||||
this.watchers[pathId].close()
|
||||
delete this.watchers[pathId]
|
||||
delete this.fragments[pathId]
|
||||
delete this.clients[pathId]
|
||||
|
||||
this.deleteFragment(pathId)
|
||||
})
|
||||
|
||||
}
|
||||
|
|
@ -54,15 +50,22 @@ class FragmentManager {
|
|||
}
|
||||
})
|
||||
}).on('unlink', ()=>{
|
||||
this.watchers[pathId].close()
|
||||
delete this.watchers[pathId]
|
||||
delete this.fragments[pathId]
|
||||
this.deleteFragment(pathIdv)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
deleteFragment(pathId) {
|
||||
|
||||
this.watchers[pathId].close()
|
||||
delete this.clients[pathId]
|
||||
delete this.fragments[pathId]
|
||||
delete this.fragments[pathId]
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue