From 11dbcfecafaa524699bb1f7fe39c5750d02d58dd Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 14 Oct 2013 16:10:57 -0700 Subject: [PATCH] Only watch path once --- src/directory.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/directory.coffee b/src/directory.coffee index b242386ef..d579b9db2 100644 --- a/src/directory.coffee +++ b/src/directory.coffee @@ -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: ->