Refactor: Remove optional chaining when calling desktopApi methods

This commit is contained in:
2026-05-06 04:41:31 +02:00
parent 672b51a28d
commit 906f731557
2 changed files with 3 additions and 3 deletions

View File

@@ -66,7 +66,7 @@ export default function AssistantMessageContent({ content, streamOutput, sources
event.preventDefault()
try {
const parsed = new URL(u)
desktopApi?.openPath?.(decodeURIComponent(parsed.pathname))
desktopApi.openPath(decodeURIComponent(parsed.pathname))
} catch {}
}}
>

View File

@@ -131,7 +131,7 @@ export default function LibraryManager({
async function addPaths() {
if (!library) return
const paths = await desktopApi?.pickPaths?.()
const paths = await desktopApi.pickPaths()
if (!Array.isArray(paths) || paths.length === 0) return
try {
await registerPaths(paths)
@@ -308,7 +308,7 @@ export default function LibraryManager({
>
{file.enrich_enabled ? 'Use Raw Only' : 'Enable Enrich'}
</button>
<button className="button ghost" onClick={() => desktopApi?.openPath?.(file.path)}>Open</button>
<button className="button ghost" onClick={() => desktopApi.openPath(file.path)}>Open</button>
<button className="button ghost" disabled={busy || isSyncing} onClick={() => removeFile(file.rel)}>Remove</button>
</div>
</div>