chore: quick fix
All checks were successful
Release / build_and_release (push) Successful in 43s

This commit is contained in:
Sabir Hassan 2024-03-05 14:08:18 +05:00
parent 22f8eeebf2
commit f670bd57f5
4 changed files with 26 additions and 17 deletions

View File

@ -114,12 +114,19 @@ export const AppBar = () => {
<MenuItem
sx={{
justifyContent: 'center',
display: { md: 'none', paddingBottom: 0, marginBottom: -10 }
display: { md: 'none' }
}}
>
<Typography variant='h5'>{username}</Typography>
<Typography variant='h6'>{username}</Typography>
</MenuItem>
<MenuItem
onClick={handleProfile}
sx={{
justifyContent: 'center'
}}
>
Profile
</MenuItem>
<MenuItem onClick={handleProfile}>Profile</MenuItem>
<Link
to={appPublicRoutes.help}
target='_blank'
@ -127,8 +134,7 @@ export const AppBar = () => {
>
<MenuItem
sx={{
justifyContent: 'center',
borderTop: '0.5px solid var(--mui-palette-text-secondary)'
justifyContent: 'center'
}}
>
Help
@ -137,8 +143,7 @@ export const AppBar = () => {
<MenuItem
onClick={handleLogout}
sx={{
justifyContent: 'center',
borderTop: '0.5px solid var(--mui-palette-text-secondary)'
justifyContent: 'center'
}}
>
Logout

View File

@ -243,10 +243,10 @@ export class NostrController {
)
}
const { private: secretKey } = keys
const nsec = new TextEncoder().encode(secretKey)
const { private: nsec } = keys
const privateKey = nip19.decode(nsec).data as Uint8Array
const signedEvent = finalizeEvent(event, nsec)
const signedEvent = finalizeEvent(event, privateKey)
verifySignedEvent(signedEvent)

View File

@ -16,7 +16,6 @@ import {
} from '../../store/actions'
import { LoginMethods } from '../../store/auth/types'
import { Dispatch } from '../../store/store'
import { nsecToHex } from '../../utils'
import styles from './style.module.scss'
import { useNavigate } from 'react-router-dom'
@ -67,9 +66,10 @@ export const Login = () => {
}
const loginWithNsec = async () => {
const hexPrivateKey = nsecToHex(inputValue)
const nsec = inputValue
const privateKey = nip19.decode(nsec).data as Uint8Array
if (!hexPrivateKey) {
if (!privateKey) {
toast.error(
'Snap, we failed to convert the private key you provided. Please make sure key is valid.'
)
@ -77,11 +77,11 @@ export const Login = () => {
return
}
const publickey = getPublicKey(new TextEncoder().encode(hexPrivateKey))
const publickey = getPublicKey(privateKey)
dispatch(
updateKeyPair({
private: hexPrivateKey,
private: nsec,
public: publickey
})
)

View File

@ -136,8 +136,10 @@ export const ProfilePage = () => {
className={styles.textField}
disabled
type={isPassword ? 'password' : 'text'}
InputProps={{
endAdornment: <ContentCopyIcon className={styles.copyItem} />
}}
/>
<ContentCopyIcon className={styles.copyItem} />
</ListItem>
)
@ -224,7 +226,9 @@ export const ProfilePage = () => {
{editItem('about', 'About', true, 4)}
{isUsersOwnProfile && (
<>
{keys && keys.public && copyItem(keys.public, 'Public Key')}
{keys &&
keys.public &&
copyItem(nip19.npubEncode(keys.public), 'Public Key')}
{keys &&
keys.private &&
copyItem(