Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Fix error emitted from nuclide-diff-gutters
Browse files Browse the repository at this point in the history
Summary:
Turns out if you have an observable with `.first()` then completes before it emits a value, it will throw an error. This was causing the observable to throw in some cases and cause the feature to stop working. `.take(1)` doesn't throw

Repro'd by adding a `.catch` to the end of the observable.  Opening some files, checking out a new revision, then using 'Close other tabs'.

Reviewed By: evangrayk

Differential Revision: D9813359

fbshipit-source-id: 71f37900122be68b08031309066635636732ed30
  • Loading branch information
TJ Ryan authored and facebook-github-bot committed Sep 13, 2018
1 parent dc6b0fc commit 8078969
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/nuclide-diff-gutters/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class Activation {
),
)
.filter(isVisible => isVisible)
.first()
.take(1)
.flatMap(() => {
const bufferPath = nullthrows(textEditor.getPath());
// TODO (tjfryan): do something to handle generated files
Expand Down

0 comments on commit 8078969

Please sign in to comment.