relay-management-fixed #83

Closed
y wants to merge 4 commits from relay-management-fixed into staging
5 changed files with 23 additions and 8 deletions

View File

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

View File

@ -86,15 +86,20 @@ export class AuthController {
store.dispatch(setRelayMapAction(relayMap.map)) store.dispatch(setRelayMapAction(relayMap.map))
} }
const visitedLink = getVisitedLink() const currentLocation = window.location.hash.replace('#', '')
if (visitedLink) { if (!Object.values(appPrivateRoutes).includes(currentLocation)) {
const { pathname, search } = visitedLink // User did change the location to one of the private routes
const visitedLink = getVisitedLink()
return Promise.resolve(`${pathname}${search}`) if (visitedLink) {
} else { const { pathname, search } = visitedLink
// Navigate user in
return Promise.resolve(appPrivateRoutes.homePage) 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 = const redirectPath =
await authController.authAndGetMetadataAndRelaysMap(pubkey) await authController.authAndGetMetadataAndRelaysMap(pubkey)
navigateAfterLogin(redirectPath) if (redirectPath) navigateAfterLogin(redirectPath)
}) })
.catch((err) => { .catch((err) => {
toast.error('Error capturing public key from nostr extension: ' + err) toast.error('Error capturing public key from nostr extension: ' + err)

View File

@ -71,6 +71,12 @@ export const RelaysPage = () => {
} }
}, [relaysInfo, relaysState?.info]) }, [relaysInfo, relaysState?.info])
useEffect(() => {
if (!compareObjects(relayMap, relaysState?.map)) {
setRelayMap(relaysState?.map)
}
}, [relayMap, relaysState?.map])
useEffect(() => { useEffect(() => {
let isMounted = false let isMounted = false

View File

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