Skip to content

Commit 1ac545e

Browse files
committed
fix: findLastIndex compatibility (Firefox ESR) (#233)
1 parent 30e9641 commit 1ac545e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/ConversationCard/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { useConfig } from '../../hooks/use-config.mjs'
1717
import { createSession } from '../../services/local-session.mjs'
1818
import { v4 as uuidv4 } from 'uuid'
1919
import { initSession } from '../../services/init-session.mjs'
20+
import { findLastIndex } from 'lodash-es'
2021

2122
const logo = Browser.runtime.getURL('logo.png')
2223

@@ -97,7 +98,7 @@ function ConversationCard(props) {
9798
const updateAnswer = (value, appended, newType, done = false) => {
9899
setConversationItemData((old) => {
99100
const copy = [...old]
100-
const index = copy.findLastIndex((v) => v.type === 'answer' || v.type === 'error')
101+
const index = findLastIndex(copy, (v) => v.type === 'answer' || v.type === 'error')
101102
if (index === -1) return copy
102103
copy[index] = new ConversationItemData(
103104
newType,

0 commit comments

Comments
 (0)