From 509eed587c70b52377cce25df95db3b7d545a341 Mon Sep 17 00:00:00 2001 From: Jay Kid Date: Thu, 21 Sep 2017 20:55:11 +0200 Subject: [PATCH] Access id instead of item.id since Fuse has flattened its object structure --- assets/scripts/src/reducers/choices.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/scripts/src/reducers/choices.js b/assets/scripts/src/reducers/choices.js index 595c5aa..5f70540 100644 --- a/assets/scripts/src/reducers/choices.js +++ b/assets/scripts/src/reducers/choices.js @@ -71,7 +71,7 @@ const choices = (state = [], action) => { // Set active state based on whether choice is // within filtered results choice.active = filteredResults.some((result) => { - if (result.item.id === choice.id) { + if (result.id === choice.id) { choice.score = result.score; return true; } diff --git a/package.json b/package.json index ed07f65..ed23216 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ }, "dependencies": { "classnames": "^2.2.5", - "fuse.js": "^2.2.2", + "fuse.js": "^3.1.0", "redux": "^3.3.1" }, "npmName": "choices.js",