Skip to content

Commit 8998f51

Browse files
committed
fix: update active app logic in AppContent and replace PageRenderer with SchemaRenderer
1 parent f259eb5 commit 8998f51

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

apps/console/src/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ function AppContent() {
2929
const defaultApp = activeApps.find((a: any) => a.isDefault === true) || activeApps[0];
3030
const [activeAppName, setActiveAppName] = useState<string>(defaultApp?.name || 'default');
3131

32+
const activeApp = apps.find((a: any) => a.name === activeAppName) || apps[0];
33+
3234
const [isDialogOpen, setIsDialogOpen] = useState(false);
3335
const [editingRecord, setEditingRecord] = useState<any>(null);
3436

@@ -63,7 +65,6 @@ function AppContent() {
6365
}
6466
}
6567

66-
const activeApp = apps.find((a: any) => a.name === activeAppName) || apps[0];
6768
const allObjects = appConfig.objects || [];
6869

6970
// Find current object definition for Dialog (Create/Edit)

apps/console/src/components/PageView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { useParams, useSearchParams } from 'react-router-dom';
7-
import { PageRenderer } from '@object-ui/components';
7+
import { SchemaRenderer } from '@object-ui/react';
88
import appConfig from '../../objectstack.config';
99

1010
export function PageView() {
@@ -30,7 +30,7 @@ export function PageView() {
3030
const params = Object.fromEntries(searchParams.entries());
3131

3232
return (
33-
<PageRenderer
33+
<SchemaRenderer
3434
schema={{
3535
type: 'page',
3636
...page,

apps/console/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function formatRecordTitle(titleFormat: string | undefined, record: any):
1414
}
1515

1616
// Replace {fieldName} patterns with actual values
17-
return titleFormat.replace(/\{(\w+)\}/g, (match, fieldName) => {
17+
return titleFormat.replace(/\{(\w+)\}/g, (_match, fieldName) => {
1818
const value = record[fieldName];
1919
if (value === null || value === undefined) {
2020
return '';

0 commit comments

Comments
 (0)