Skip to content

Commit 148234f

Browse files
Copilothotlong
andcommitted
fix(console): move useAuth hook call before early returns in AppContent to comply with rules of hooks
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 87a388f commit 148234f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/console/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import { ThemeProvider } from './components/theme-provider';
3838
export function AppContent() {
3939
const [dataSource, setDataSource] = useState<ObjectStackAdapter | null>(null);
4040
const [connectionState, setConnectionState] = useState<ConnectionState>('disconnected');
41+
const { user } = useAuth();
4142

4243
// App Selection
4344
const navigate = useNavigate();
@@ -145,7 +146,6 @@ export function AppContent() {
145146
);
146147

147148
// Expression context for dynamic visibility/disabled/hidden expressions
148-
const { user } = useAuth();
149149
const expressionUser = user
150150
? { name: user.name, email: user.email, role: user.role ?? 'user' }
151151
: { name: 'Anonymous', email: '', role: 'guest' };

0 commit comments

Comments
 (0)