From 87e3fc77d89885012c64c462c1cf761c04a75cd7 Mon Sep 17 00:00:00 2001 From: m5r Date: Mon, 30 Aug 2021 07:13:06 +0800 Subject: [PATCH] fix most lint warnings --- app/blog/components/cover-image.tsx | 1 + app/core/hooks/use-panelbear.ts | 1 + app/messages/components/conversation.tsx | 4 ++-- app/messages/pages/messages.tsx | 2 +- app/phone-calls/pages/outgoing-call/[recipient].tsx | 1 + app/public-area/components/header.tsx | 2 +- 6 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/blog/components/cover-image.tsx b/app/blog/components/cover-image.tsx index b2288f3..5b74971 100644 --- a/app/blog/components/cover-image.tsx +++ b/app/blog/components/cover-image.tsx @@ -4,6 +4,7 @@ import Link from "next/link"; export default function CoverImage({ title, responsiveImage, slug }: any) { const image = ( + // eslint-disable-next-line jsx-a11y/alt-text { router.events.on("routeChangeComplete", handleRouteChange); return () => router.events.off("routeChangeComplete", handleRouteChange); + // eslint-disable-next-line }, [siteId]); }; diff --git a/app/messages/components/conversation.tsx b/app/messages/components/conversation.tsx index ff307c2..888188b 100644 --- a/app/messages/components/conversation.tsx +++ b/app/messages/components/conversation.tsx @@ -1,4 +1,4 @@ -import { Suspense, useEffect, useRef } from "react"; +import { Suspense, useEffect, useMemo, useRef } from "react"; import { useRouter } from "blitz"; import clsx from "clsx"; @@ -10,7 +10,7 @@ export default function Conversation() { const router = useRouter(); const recipient = decodeURIComponent(router.params.recipient); const conversation = useConversation(recipient)[0]; - const messages = conversation?.messages ?? []; + const messages = useMemo(() => conversation?.messages ?? [], [conversation?.messages]); const messagesListRef = useRef(null); useEffect(() => { diff --git a/app/messages/pages/messages.tsx b/app/messages/pages/messages.tsx index 339bced..5cd9f27 100644 --- a/app/messages/pages/messages.tsx +++ b/app/messages/pages/messages.tsx @@ -19,7 +19,7 @@ const Messages: BlitzPage = () => { if (!subscription) { subscribe(); } - }, [subscription?.endpoint]); + }, [subscribe, subscription]); return ( <> diff --git a/app/phone-calls/pages/outgoing-call/[recipient].tsx b/app/phone-calls/pages/outgoing-call/[recipient].tsx index 004d176..c3b620e 100644 --- a/app/phone-calls/pages/outgoing-call/[recipient].tsx +++ b/app/phone-calls/pages/outgoing-call/[recipient].tsx @@ -41,6 +41,7 @@ const OutgoingCall: BlitzPage = () => { if (call.state === "ready") { call.makeCall(); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [call.state]); return ( diff --git a/app/public-area/components/header.tsx b/app/public-area/components/header.tsx index 37d7999..95c1276 100644 --- a/app/public-area/components/header.tsx +++ b/app/public-area/components/header.tsx @@ -12,7 +12,7 @@ function Header() {
- + Shellphone logo