diff --git a/src/components/Bookmarks.tsx b/src/components/Bookmarks.tsx index 96d3ddbf..6a4c5acf 100644 --- a/src/components/Bookmarks.tsx +++ b/src/components/Bookmarks.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react' +import React, { useState, useEffect, useCallback } from 'react' import { Hooks } from 'applesauce-react' import { useEventStore } from 'applesauce-react/hooks' import { RelayPool } from 'applesauce-relay' @@ -114,7 +114,7 @@ const Bookmarks: React.FC = ({ relayPool, onLogout }) => { } } - const handleSaveSettings = async (newSettings: UserSettings) => { + const handleSaveSettings = useCallback(async (newSettings: UserSettings) => { if (!relayPool || !activeAccount) return try { const fullAccount = accountManager.getActive() @@ -129,7 +129,7 @@ const Bookmarks: React.FC = ({ relayPool, onLogout }) => { setToastType('error') setToastMessage('Failed to save settings') } - } + }, [relayPool, activeAccount, accountManager, eventStore]) const handleSelectUrl = async (url: string) => { setSelectedUrl(url) diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx index 03647136..ba3cbe8e 100644 --- a/src/components/Settings.tsx +++ b/src/components/Settings.tsx @@ -40,7 +40,8 @@ const Settings: React.FC = ({ settings, onSave, onClose }) => { } onSave(localSettings) - }, [localSettings, onSave]) + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [localSettings]) const previewFontFamily = getFontFamily(localSettings.readingFont)