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) {