Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit c874d9b

Browse files
WliuWliu
Wliu
authored and
Wliu
committed
Fix remaining specs
1 parent 14a3af0 commit c874d9b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

lib/directory-view.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,14 @@ class DirectoryView {
115115
createViewForEntry(entry) {
116116
const view = entry instanceof Directory ? new DirectoryView(entry) : new FileView(entry)
117117

118-
this.subscriptions.add(this.directory.onDidRemoveEntries(removedEntries => {
118+
const subscription = this.directory.onDidRemoveEntries(removedEntries => {
119119
if (removedEntries.has(entry)) {
120120
view.element.remove()
121121
subscription.dispose()
122122
}
123-
}))
123+
})
124+
125+
this.subscriptions.add(subscription)
124126

125127
return view
126128
}

lib/directory.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,12 @@ class Directory {
247247
try {
248248
this.watchSubscription = PathWatcher.watch(this.path, eventType => {
249249
switch (eventType) {
250-
case 'change': this.reload()
251-
case 'delete': this.destroy()
250+
case 'change':
251+
this.reload()
252+
break
253+
case 'delete':
254+
this.destroy()
255+
break
252256
}
253257
})
254258
} catch (error) {}

0 commit comments

Comments
 (0)