Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/extensions/ExtensionBisect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const ExtensionBisect: Component<ExtensionBisectProps> = (props) => {
// Get the found extension details
const foundExtensionDetails = createMemo(() => {
if (!state.foundExtension) return null;
return extensions.extensions().find(
return (extensions.extensions() || []).find(
e => e.manifest.name === state.foundExtension
);
});
Expand Down
6 changes: 3 additions & 3 deletions src/components/extensions/ExtensionMarketplace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const ExtensionMarketplace: Component<ExtensionMarketplaceProps> = (props

// Get list of installed extension names for comparison
const installedNames = createMemo(() =>
new Set(extensions().map((ext) => ext.manifest.name))
new Set((extensions() || []).map((ext) => ext.manifest.name))
);

// Filter marketplace extensions based on search and category
Expand Down Expand Up @@ -114,7 +114,7 @@ export const ExtensionMarketplace: Component<ExtensionMarketplaceProps> = (props

// Filter installed extensions based on search and category
const filteredInstalled = createMemo(() => {
let exts = extensions();
let exts = extensions() || [];
const query = searchQuery().toLowerCase();

// Apply text search
Expand Down Expand Up @@ -418,7 +418,7 @@ export const ExtensionMarketplace: Component<ExtensionMarketplaceProps> = (props
"border-radius": "var(--cortex-radius-full)",
}}
>
{extensions().length}
{(extensions() || []).length}
</span>
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/extensions/ExtensionPackView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const ExtensionPackView: Component<ExtensionPackViewProps> = (props) => {
const currentPack = pack();
if (!currentPack) return [];

const installedExtensions = extensions();
const installedExtensions = extensions() || [];

return currentPack.extensionIds.map((id) => {
const ext = installedExtensions.find((e) => e.manifest.name === id);
Expand Down
4 changes: 2 additions & 2 deletions src/components/extensions/ExtensionProfiler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export const ExtensionProfiler: Component<ExtensionProfilerProps> = (props) => {

// Build profiles from runtime state
const buildProfiles = (): ExtensionProfile[] => {
const runtimeStates = runtime.extensions();
const enabledExts = enabledExtensions();
const runtimeStates = runtime.extensions() || [];
const enabledExts = enabledExtensions() || [];

return runtimeStates.map((state) => {
const ext = enabledExts.find((e) => e.manifest.name === state.id);
Expand Down
4 changes: 2 additions & 2 deletions src/components/extensions/ExtensionRuntimeStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const RuntimeStatusBadge: Component<RuntimeStatusBadgeProps> = (props) =>

// Get runtime state for this extension
const runtimeState = createMemo(() => {
return runtime.extensions().find((s) => s.id === props.extensionId);
return (runtime.extensions() || []).find((s) => s.id === props.extensionId);
});

// Determine display status
Expand Down Expand Up @@ -266,7 +266,7 @@ export const RuntimeStatusSummary: Component = () => {
const runtime = useExtensionRuntime();

const stats = createMemo(() => {
const states = runtime.extensions();
const states = runtime.extensions() || [];
const active = states.filter(
(s) => s.status === ExtensionStatus.Active
).length;
Expand Down
4 changes: 2 additions & 2 deletions src/components/extensions/ExtensionsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const ExtensionsPanel: Component<ExtensionsPanelProps> = (props) => {
return [];
}

let exts = extensions();
let exts = extensions() || [];
const query = searchQuery().toLowerCase();

// Apply text search
Expand Down Expand Up @@ -204,7 +204,7 @@ export const ExtensionsPanel: Component<ExtensionsPanelProps> = (props) => {
<h2 style={{ margin: 0, "font-size": "16px", "font-weight": 600 }}>
Extensions
</h2>
<Badge size="md">{extensions().length}</Badge>
<Badge size="md">{(extensions() || []).length}</Badge>
{/* Updates available badge */}
<Show when={outdatedCount() > 0}>
<div
Expand Down
8 changes: 4 additions & 4 deletions src/components/extensions/PluginManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const PluginManager: Component<PluginManagerProps> = (props) => {
};

const metricsInfo = () => {
const exts = extensions();
const exts = extensions() || [];
const withTime = exts.filter((e) => e.activationTime != null);
if (withTime.length === 0) return null;
const avg = withTime.reduce((s, e) => s + e.activationTime!, 0) / withTime.length;
Expand Down Expand Up @@ -227,13 +227,13 @@ export const PluginManager: Component<PluginManagerProps> = (props) => {
</div>
</Show>

<Show when={!loading() && !error() && extensions().length === 0}>
<Show when={!loading() && !error() && (extensions() || []).length === 0}>
<EmptyState icon="puzzle-piece" title="No extensions installed" description="Install extensions from the marketplace to get started." />
</Show>

<Show when={!loading() && !error() && extensions().length > 0}>
<Show when={!loading() && !error() && (extensions() || []).length > 0}>
<div class="flex-1 overflow-y-auto">
<For each={extensions()}>
<For each={extensions() || []}>
{(ext) => {
const busy = () => busyIds().has(ext.id);
return (
Expand Down
Loading