Compare commits

...

4 Commits

Author SHA1 Message Date
Yury
5e9594e65c fix(Relays): add color to the container class 2024-05-28 10:30:27 +03:00
Yury
0280ebade5 fix(Relays): fixed relay map state 2024-05-28 10:27:22 +03:00
Yury
3b704d2500 fix(Auth): fixed redirect 2024-05-28 10:26:46 +03:00
Yury
5e1d63289b fix(AppBar): fixed not closing menu 2024-05-28 10:25:42 +03:00
5 changed files with 23 additions and 8 deletions

View File

@ -170,6 +170,8 @@ export const AppBar = () => {
</MenuItem>
<MenuItem
onClick={() => {
setAnchorElUser(null)
navigate(appPrivateRoutes.relays)
}}
sx={{

View File

@ -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)
}
}
}

View File

@ -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)

View File

@ -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

View File

@ -2,6 +2,7 @@
.container {
margin-top: 25px;
color: $text-color;
.relayURItextfield {
width: 100%;