relay-management-fixed #83

Closed
y wants to merge 4 commits from relay-management-fixed into staging
2 changed files with 14 additions and 8 deletions
Showing only changes of commit 3b704d2500 - Show all commits

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)