Skip to content

Commit 5f27d6c

Browse files
committed
fix: move useState before early returns to fix React hooks ordering crash
1 parent c61a5fe commit 5f27d6c

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎apps/observatory/src/pages/ClientDetailPage.tsx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export const ClientDetailPage: React.FC = () => {
3838
const [assigning, setAssigning] = useState(false);
3939
const [assignError, setAssignError] = useState<string | null>(null);
4040
const [syncing, setSyncing] = useState(false);
41+
const [syncError, setSyncError] = useState<string | null>(null);
4142
const [unassigningAgent, setUnassigningAgent] = useState<string | null>(null);
4243

4344
if (loading) {
@@ -85,8 +86,6 @@ export const ClientDetailPage: React.FC = () => {
8586
setUnassigningAgent(null);
8687
};
8788

88-
const [syncError, setSyncError] = useState<string | null>(null);
89-
9089
const handleSync = async () => {
9190
setSyncing(true);
9291
setSyncError(null);

0 commit comments

Comments
 (0)