From 5e1d63289bd86f0bd2d25fca392856ee5da1a862 Mon Sep 17 00:00:00 2001 From: Yury Date: Tue, 28 May 2024 10:25:42 +0300 Subject: [PATCH 1/4] fix(AppBar): fixed not closing menu --- src/components/AppBar/AppBar.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/AppBar/AppBar.tsx b/src/components/AppBar/AppBar.tsx index b392d9a..a7b91bd 100644 --- a/src/components/AppBar/AppBar.tsx +++ b/src/components/AppBar/AppBar.tsx @@ -170,6 +170,8 @@ export const AppBar = () => { { + setAnchorElUser(null) + navigate(appPrivateRoutes.relays) }} sx={{ -- 2.34.1 From 3b704d2500a13ef0018c48807ab9e84520bcac98 Mon Sep 17 00:00:00 2001 From: Yury Date: Tue, 28 May 2024 10:26:46 +0300 Subject: [PATCH 2/4] fix(Auth): fixed redirect --- src/controllers/AuthController.ts | 19 ++++++++++++------- src/pages/login/index.tsx | 3 ++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/controllers/AuthController.ts b/src/controllers/AuthController.ts index c2efb4c..1b7dc0b 100644 --- a/src/controllers/AuthController.ts +++ b/src/controllers/AuthController.ts @@ -86,15 +86,20 @@ export class AuthController { store.dispatch(setRelayMapAction(relayMap.map)) } - const visitedLink = getVisitedLink() + const currentLocation = window.location.hash.replace('#', '') - if (visitedLink) { - const { pathname, search } = visitedLink + if (!Object.values(appPrivateRoutes).includes(currentLocation)) { + // User did change the location to one of the private routes + const visitedLink = getVisitedLink() - return Promise.resolve(`${pathname}${search}`) - } else { - // Navigate user in - return Promise.resolve(appPrivateRoutes.homePage) + if (visitedLink) { + const { pathname, search } = visitedLink + + return Promise.resolve(`${pathname}${search}`) + } else { + // Navigate user in + return Promise.resolve(appPrivateRoutes.homePage) + } } } diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx index cd3d606..0820b23 100644 --- a/src/pages/login/index.tsx +++ b/src/pages/login/index.tsx @@ -82,7 +82,8 @@ export const Login = () => { const redirectPath = await authController.authAndGetMetadataAndRelaysMap(pubkey) - navigateAfterLogin(redirectPath) + if (redirectPath) navigateAfterLogin(redirectPath) + }) .catch((err) => { toast.error('Error capturing public key from nostr extension: ' + err) -- 2.34.1 From 0280ebade59bce576c08e3b26bffb4d2a520c03f Mon Sep 17 00:00:00 2001 From: Yury Date: Tue, 28 May 2024 10:27:22 +0300 Subject: [PATCH 3/4] fix(Relays): fixed relay map state --- src/pages/relays/index.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pages/relays/index.tsx b/src/pages/relays/index.tsx index 010d24d..c5ba03f 100644 --- a/src/pages/relays/index.tsx +++ b/src/pages/relays/index.tsx @@ -71,6 +71,12 @@ export const RelaysPage = () => { } }, [relaysInfo, relaysState?.info]) + useEffect(() => { + if (!compareObjects(relayMap, relaysState?.map)) { + setRelayMap(relaysState?.map) + } + }, [relayMap, relaysState?.map]) + useEffect(() => { let isMounted = false -- 2.34.1 From 5e9594e65c0798c3a1710af2ace94c121092d70d Mon Sep 17 00:00:00 2001 From: Yury Date: Tue, 28 May 2024 10:30:27 +0300 Subject: [PATCH 4/4] fix(Relays): add color to the container class --- src/pages/relays/style.module.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/relays/style.module.scss b/src/pages/relays/style.module.scss index 6fcb8b7..25d6347 100644 --- a/src/pages/relays/style.module.scss +++ b/src/pages/relays/style.module.scss @@ -2,6 +2,7 @@ .container { margin-top: 25px; + color: $text-color; .relayURItextfield { width: 100%; -- 2.34.1