Refactor: Remove optional chaining when calling desktopApi methods
This commit is contained in:
@@ -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 {}
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user