From a8cf7879a2de585ea2738e3f3b9c091396ff7b32 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Mon, 6 Nov 2023 23:31:00 +0800 Subject: [PATCH] Fix promise error with fetching followed hashtags Remove memoization for now --- src/components/shortcuts-settings.jsx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/components/shortcuts-settings.jsx b/src/components/shortcuts-settings.jsx index 9d5bb516..67570d98 100644 --- a/src/components/shortcuts-settings.jsx +++ b/src/components/shortcuts-settings.jsx @@ -466,15 +466,6 @@ const fetchLists = pmem( maxAge: FETCH_MAX_AGE, }, ); -const fetchFollowedHashtags = pmem( - () => { - const { masto } = api(); - return masto.v1.followedTags.list(); - }, - { - maxAge: FETCH_MAX_AGE, - }, -); function ShortcutForm({ onSubmit, @@ -486,6 +477,7 @@ function ShortcutForm({ console.log('shortcut', shortcut); const editMode = !!shortcut; const [currentType, setCurrentType] = useState(shortcut?.type || null); + const { masto } = api(); const [uiState, setUIState] = useState('default'); const [lists, setLists] = useState([]); @@ -508,7 +500,7 @@ function ShortcutForm({ (async () => { if (currentType !== 'hashtag') return; try { - const iterator = fetchFollowedHashtags(); + const iterator = masto.v1.followedTags.list(); const tags = []; do { const { value, done } = await iterator.next();