Skip to content

Commit 813f142

Browse files
committed
fix: refresh clients list when navigating from Manage Permissions button
After OAuth approval, clicking "Manage Permissions" navigates to the Clients page but the list could be stale. Emit oauth-client-changed event after a short delay so the ClientsPage picks up the new client after mounting and subscribing to events. Signed-off-by: mcpmux <mcpmux@users.noreply.github.com> Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
1 parent a06dee7 commit 813f142

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

apps/desktop/src/components/OAuthConsentModal.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import { useState, useEffect } from 'react';
1414
import { invoke } from '@tauri-apps/api/core';
15-
import { listen } from '@tauri-apps/api/event';
15+
import { listen, emit } from '@tauri-apps/api/event';
1616
import { Check, X, AlertCircle, Loader2, Globe, Lock } from 'lucide-react';
1717
import { Button, Card, CardHeader, CardTitle, CardDescription, CardContent } from '@mcpmux/ui';
1818
import { listSpaces, type Space } from '@/lib/api/spaces';
@@ -328,8 +328,13 @@ export function OAuthConsentModal() {
328328
variant="primary"
329329
className="flex-1 whitespace-nowrap"
330330
onClick={() => {
331-
navigateTo('clients');
332331
handleDismiss();
332+
navigateTo('clients');
333+
// Emit event after a short delay so ClientsPage has time to mount
334+
// and subscribe to the event before it fires
335+
setTimeout(() => {
336+
emit('oauth-client-changed', { action: 'approved' });
337+
}, 300);
333338
}}
334339
data-testid="go-to-clients-btn"
335340
>

0 commit comments

Comments
 (0)