Skip to content
This repository has been archived by the owner on Nov 25, 2021. It is now read-only.

Commit

Permalink
fix: unpin when actions are empty array (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfbecker committed Jul 18, 2019
1 parent 47adbe8 commit b8a2208
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/hoverifier.ts
Expand Up @@ -756,7 +756,10 @@ export function createHoverifier<C extends object, D, A>({
if (!position) {
return of(null)
}
return concat([LOADING], from(getActions(position)).pipe(catchError(error => [asError(error)]))).pipe(
return concat(
[LOADING],
from(getActions(position)).pipe(catchError((error): [ErrorLike] => [asError(error)]))
).pipe(
// Do not emit anything after the code view this action came from got unhoverified
takeUntil(allUnhoverifies.pipe(filter(unhoverifiedCodeViewId => unhoverifiedCodeViewId === codeViewId)))
)
Expand Down Expand Up @@ -801,7 +804,12 @@ export function createHoverifier<C extends object, D, A>({
// In the time between the click/jump and the loader being displayed,
// pin the hover overlay so mouseover events get ignored
// If the hover comes back empty (and the definition) it will get unpinned again
Boolean(hoverOrError === undefined || (actionsOrError && !isErrorLike(actionsOrError)))
Boolean(
hoverOrError === undefined ||
(actionsOrError &&
!(Array.isArray(actionsOrError) && actionsOrError.length === 0) &&
!isErrorLike(actionsOrError))
)
)
)
})
Expand Down

0 comments on commit b8a2208

Please sign in to comment.