fix(login): update login method before using nostrController instance

This commit is contained in:
enes 2024-12-31 12:09:12 +01:00
parent 1909534079
commit 1f980201dd

View File

@ -58,12 +58,12 @@ export const MainLayout = () => {
} }
const login = useCallback(async () => { const login = useCallback(async () => {
dispatch(updateLoginMethod(LoginMethod.nostrLogin))
const nostrController = NostrController.getInstance() const nostrController = NostrController.getInstance()
const authController = new AuthController() const authController = new AuthController()
const pubkey = await nostrController.capturePublicKey() const pubkey = await nostrController.capturePublicKey()
dispatch(updateLoginMethod(LoginMethod.nostrLogin))
const redirectPath = const redirectPath =
await authController.authAndGetMetadataAndRelaysMap(pubkey) await authController.authAndGetMetadataAndRelaysMap(pubkey)