From 7b7866d2e4495c6a13f40d510ad1845af2734ab7 Mon Sep 17 00:00:00 2001 From: kawamataryo Date: Sun, 14 Jan 2024 06:14:47 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20fixed=20a=20bug=20where=20?= =?UTF-8?q?the=20form=20could=20not=20be=20filled=20out?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/popup.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/popup.tsx b/src/popup.tsx index a202fa8..86eef6b 100644 --- a/src/popup.tsx +++ b/src/popup.tsx @@ -1,4 +1,4 @@ -import { type FormEvent, useEffect, useState } from "react"; +import { type FormEvent, useCallback, useEffect, useState } from "react"; import { P, match } from "ts-pattern"; import "./style.css"; @@ -45,7 +45,7 @@ function IndexPopup() { }); }; - const loadCredentialsFromStorage = async () => { + const loadCredentialsFromStorage = useCallback(async () => { chrome.storage.local.get( [STORAGE_KEYS.BSKY_PASSWORD, STORAGE_KEYS.BSKY_USER_ID], (result) => { @@ -53,7 +53,7 @@ function IndexPopup() { setUserId(result[STORAGE_KEYS.BSKY_USER_ID] || ""); }, ); - }; + }, []); const searchBskyUser = async (e?: FormEvent) => { if (e) {