Skip to content

Commit 96a7374

Browse files
committed
chore(dashboard): remove forceful refreshes meant for the legacy sidebar
1 parent d92bccb commit 96a7374

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

packages/apps/app-dashboard/src/components/user-dashboard/dashboard/RepermitConnectPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ export function RepermitConnectPage({
9898
if (effectiveRedirectUri) {
9999
await generateJWT(appData, appData.activeVersion!);
100100
} else {
101-
// Navigate to the app permissions page with full refresh to update sidebar
102-
window.location.href = `/user/appId/${appData.appId}`;
101+
// Navigate to the app permissions page
102+
navigate(`/user/appId/${appData.appId}`);
103103
}
104104
} catch (error) {
105105
setLocalError(error instanceof Error ? error.message : 'Failed to re-permit app');

packages/apps/app-dashboard/src/components/user-dashboard/dashboard/UpdateVersionPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ export function UpdateVersionPage({
125125
if (redirectUri) {
126126
await generateJWT(connectInfoMap.app, connectInfoMap.app.activeVersion!);
127127
} else {
128-
// Navigate to the app permissions page with full refresh to update sidebar
129-
window.location.href = `/user/appId/${connectInfoMap.app.appId}`;
128+
// Navigate to the app permissions page
129+
navigate(`/user/appId/${connectInfoMap.app.appId}`);
130130
}
131131
} catch (error) {
132132
setLocalError(error instanceof Error ? error.message : 'Failed to update version');

packages/apps/app-dashboard/src/components/user-dashboard/dashboard/UserPermissionPage.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useState, useCallback, useRef, useEffect } from 'react';
2+
import { useNavigate } from 'react-router-dom';
23
import * as Sentry from '@sentry/react';
34
import { PKPEthersWallet } from '@lit-protocol/pkp-ethers';
45
import { IRelayPKP } from '@lit-protocol/types';
@@ -39,6 +40,7 @@ export function AppPermissionPage({
3940
appVersionsMap,
4041
onBackToConsent,
4142
}: AppPermissionPageProps) {
43+
const navigate = useNavigate();
4244
const appIdString = connectInfoMap.app.appId.toString();
4345
const permittedVersion = permittedAppVersions[appIdString];
4446

@@ -273,8 +275,8 @@ export function AppPermissionPage({
273275
setLocalStatus(null);
274276
// Show success state until redirect
275277
setLocalSuccess('App unpermitted successfully!');
276-
// Force the refresh for the sidebar to update
277-
window.location.href = `/user/apps`;
278+
// Navigate to apps page
279+
navigate('/user/apps');
278280
} catch (error) {
279281
setLocalError(error instanceof Error ? error.message : 'Failed to unpermit app');
280282
setLocalStatus(null);

0 commit comments

Comments
 (0)