Skip to content

Commit

Permalink
fix: Fix menu open notification(s)
Browse files Browse the repository at this point in the history
Fix duplication of notification on menu open and and first notification after menu open being 'change' instead of 'move'.
  • Loading branch information
QuentinRoy committed Aug 1, 2017
1 parent 91fc285 commit a9ace25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/navigation/noviceNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ const noviceNavigation = (drag$, menu, options) => {
.map(n => Object.assign({ type: 'open', menu }, n));

// Analyse local movements.
const moves$ = angleDrag$.scan((last, n) => {
const moves$ = angleDrag$.skip(1).scan((last, n) => {
const distFromCenter = dist(n.center, n.position);
const active =
distFromCenter < minSelectionDist
? null
: menu.getNearestChildren(n.alpha);
const type = last && last.active === active ? 'move' : 'change';
const type = !last || last.active === active ? 'move' : 'change';
return Object.assign({ active, type, distFromCenter }, n);
}, null);

Expand Down

0 comments on commit a9ace25

Please sign in to comment.