From f51afe3b677d418cdf4c4d29132f63f9ff1bd56b Mon Sep 17 00:00:00 2001 From: enes Date: Mon, 5 Aug 2024 09:49:56 +0200 Subject: [PATCH] fix: some linter warnings and an error --- src/layouts/Main.tsx | 2 +- src/pages/nostr/index.tsx | 2 +- src/pages/settings/profile/index.tsx | 6 +++--- src/utils/nostr.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/layouts/Main.tsx b/src/layouts/Main.tsx index c8f9f27..ee82da3 100644 --- a/src/layouts/Main.tsx +++ b/src/layouts/Main.tsx @@ -145,7 +145,7 @@ export const MainLayout = () => { }) .finally(() => setIsLoading(false)) } - }, [authState]) + }, [authState, dispatch]) if (isLoading) return diff --git a/src/pages/nostr/index.tsx b/src/pages/nostr/index.tsx index 562f184..bd99485 100644 --- a/src/pages/nostr/index.tsx +++ b/src/pages/nostr/index.tsx @@ -51,7 +51,7 @@ export const Nostr = () => { /** * Call login function when enter is pressed */ - const handleInputKeyDown = (event: any) => { + const handleInputKeyDown = (event: React.KeyboardEvent) => { if (event.code === 'Enter' || event.code === 'NumpadEnter') { event.preventDefault() login() diff --git a/src/pages/settings/profile/index.tsx b/src/pages/settings/profile/index.tsx index 7dd2d0d..7d6c923 100644 --- a/src/pages/settings/profile/index.tsx +++ b/src/pages/settings/profile/index.tsx @@ -12,7 +12,7 @@ import { useTheme } from '@mui/material' import { UnsignedEvent, nip19, kinds, VerifiedEvent, Event } from 'nostr-tools' -import { useEffect, useMemo, useRef, useState } from 'react' +import React, { useEffect, useMemo, useRef, useState } from 'react' import { Link, useParams } from 'react-router-dom' import { toast } from 'react-toastify' import { MetadataController, NostrController } from '../../../controllers' @@ -321,8 +321,8 @@ export const ProfileSettingsPage = () => { }} > { - event.target.src = getRoboHashPicture(npub!) + onError={(event: React.SyntheticEvent) => { + event.currentTarget.src = getRoboHashPicture(npub!) }} className={styles.img} src={getProfileImage(profileMetadata)} diff --git a/src/utils/nostr.ts b/src/utils/nostr.ts index ff38faa..e27601b 100644 --- a/src/utils/nostr.ts +++ b/src/utils/nostr.ts @@ -120,7 +120,7 @@ export const queryNip05 = async ( if (!match) throw new Error('Invalid nip05') // Destructure the match result, assigning default value '_' to name if not provided - const [_, name = '_', domain] = match + const [, name = '_', domain] = match // Construct the URL to query the NIP-05 data const url = `https://${domain}/.well-known/nostr.json?name=${name}`