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()
|
event.preventDefault()
|
||||||
try {
|
try {
|
||||||
const parsed = new URL(u)
|
const parsed = new URL(u)
|
||||||
desktopApi?.openPath?.(decodeURIComponent(parsed.pathname))
|
desktopApi.openPath(decodeURIComponent(parsed.pathname))
|
||||||
} catch {}
|
} catch {}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ export default function LibraryManager({
|
|||||||
|
|
||||||
async function addPaths() {
|
async function addPaths() {
|
||||||
if (!library) return
|
if (!library) return
|
||||||
const paths = await desktopApi?.pickPaths?.()
|
const paths = await desktopApi.pickPaths()
|
||||||
if (!Array.isArray(paths) || paths.length === 0) return
|
if (!Array.isArray(paths) || paths.length === 0) return
|
||||||
try {
|
try {
|
||||||
await registerPaths(paths)
|
await registerPaths(paths)
|
||||||
@@ -308,7 +308,7 @@ export default function LibraryManager({
|
|||||||
>
|
>
|
||||||
{file.enrich_enabled ? 'Use Raw Only' : 'Enable Enrich'}
|
{file.enrich_enabled ? 'Use Raw Only' : 'Enable Enrich'}
|
||||||
</button>
|
</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>
|
<button className="button ghost" disabled={busy || isSyncing} onClick={() => removeFile(file.rel)}>Remove</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user