diff --git a/web/source/settings/admin/federation.js b/web/source/settings/admin/federation.js index f1023d365..0547c97ca 100644 --- a/web/source/settings/admin/federation.js +++ b/web/source/settings/admin/federation.js @@ -31,6 +31,7 @@ const adminActions = require("../redux/reducers/admin").actions; const submit = require("../lib/submit"); const BackButton = require("../components/back-button"); const Loading = require("../components/loading"); +const { matchSorter } = require("match-sorter"); const base = "/settings/admin/federation"; @@ -79,6 +80,10 @@ function InstanceOverview() { const blockedInstances = Redux.useSelector(state => state.admin.blockedInstances); const [_location, setLocation] = useLocation(); + const filteredInstances = React.useMemo(() => { + return matchSorter(Object.values(blockedInstances), filter, {keys: ["domain"]}); + }, [blockedInstances, filter]); + function filterFormSubmit(e) { e.preventDefault(); setLocation(`${base}/${filter}`); @@ -96,7 +101,7 @@ function InstanceOverview() { Add block