diff --git a/src/renderer/components/sidebar/Sidebar.js b/src/renderer/components/sidebar/Sidebar.js index 8c0c1c34..4c7d27b3 100644 --- a/src/renderer/components/sidebar/Sidebar.js +++ b/src/renderer/components/sidebar/Sidebar.js @@ -92,7 +92,7 @@ const useModel = () => { const unpin = id => store.removeTag(id, 'pin') const link = id => { - const entry = R.find(R.propEq('id', id), state.entries) + const entry = R.find(R.propEq(id, 'id'), state.entries) setHistory([...search.history, { key: id, label: entry.title, @@ -101,7 +101,7 @@ const useModel = () => { } const polygon = async id => { - const entry = R.find(R.propEq('id', id), state.entries) + const entry = R.find(R.propEq(id, 'id'), state.entries) const geometry = await store.geometry(id) setHistory([...search.history, { scope: `@feature &geometry:${JSON.stringify(geometry)}`, @@ -111,7 +111,7 @@ const useModel = () => { } const layerOpen = id => { - const entry = R.find(R.propEq('id', id), state.entries) + const entry = R.find(R.propEq(id, 'id'), state.entries) setHistory([...search.history, { scope: `@feature !feature:${ID.layerUUID(id)}`, key: id, diff --git a/src/renderer/model/selection/helpers.js b/src/renderer/model/selection/helpers.js index 82990cd3..007f0be5 100644 --- a/src/renderer/model/selection/helpers.js +++ b/src/renderer/model/selection/helpers.js @@ -6,7 +6,7 @@ export const Q = {} // queries Q.ids = R.pluck('id') Q.id = (index, entries) => entries[index].id Q.comparator = R.comparator(R.lt) -Q.index = (id, entries) => R.findIndex(R.propEq('id', id), entries) +Q.index = (id, entries) => R.findIndex(R.propEq(id, 'id'), entries) Q.clamp = (index, entries) => Math.min(Math.max(index, 0), entries.length - 1) Q.append = (xs, x) => xs.includes(x) ? xs : [...xs, x] Q.isEmpty = xs => xs.length === 0