Only watch path once

This commit is contained in:
Kevin Sawicki
2013-10-14 16:10:57 -07:00
parent 6318571fed
commit 11dbcfecaf

View File

@@ -96,8 +96,9 @@ class Directory
# Private:
subscribeToNativeChangeEvents: ->
@watchSubscription = pathWatcher.watch @path, (eventType) =>
@emit "contents-changed" if eventType is "change"
if @watchSubscription?
@watchSubscription = pathWatcher.watch @path, (eventType) =>
@emit "contents-changed" if eventType is "change"
# Private:
unsubscribeFromNativeChangeEvents: ->