fix(app): don't use findLast

This commit is contained in:
adamelmore
2026-01-24 12:36:42 -06:00
parent d90b4c9ebd
commit 1080f37f9c
6 changed files with 24 additions and 9 deletions

View File

@@ -42,6 +42,7 @@ import { Checkbox } from "./checkbox"
import { DiffChanges } from "./diff-changes"
import { Markdown } from "./markdown"
import { ImagePreview } from "./image-preview"
import { findLast } from "@opencode-ai/util/array"
import { getDirectory as _getDirectory, getFilename } from "@opencode-ai/util/path"
import { checksum } from "@opencode-ai/util/encode"
import { Tooltip } from "./tooltip"
@@ -891,7 +892,7 @@ ToolRegistry.register({
if (!sessionId) return undefined
// Find the tool part that matches the permission's callID
const messages = data.store.message[sessionId] ?? []
const message = messages.findLast((m) => m.id === perm.tool!.messageID)
const message = findLast(messages, (m) => m.id === perm.tool!.messageID)
if (!message) return undefined
const parts = data.store.part[message.id] ?? []
for (const part of parts) {