Skip to content

Commit

Permalink
ramda: aligned code with breaking change (R.propEq).
Browse files Browse the repository at this point in the history
  • Loading branch information
dehmer committed Jun 14, 2024
1 parent 2679942 commit b224a57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/renderer/components/sidebar/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)}`,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/model/selection/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b224a57

Please sign in to comment.