From 66f9c3b9182dcfcbd2286fdaa4f43e7c5d714193 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 20 Oct 2023 20:54:24 +0800 Subject: [PATCH] Fix async/await --- src/pages/account-statuses.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/account-statuses.jsx b/src/pages/account-statuses.jsx index f24a416a..ba17ba1a 100644 --- a/src/pages/account-statuses.jsx +++ b/src/pages/account-statuses.jsx @@ -30,9 +30,9 @@ const supportsInputMonth = (() => { } })(); -function _isSearchEnabled(instance) { +async function _isSearchEnabled(instance) { const { masto } = api({ instance }); - const results = masto.v2.search.fetch({ + const results = await masto.v2.search.fetch({ q: 'from:me', type: 'statuses', limit: 1, @@ -72,6 +72,7 @@ function AccountStatuses() { if (!account?.acct) return; (async () => { const enabled = await isSearchEnabled(instance); + console.log({ enabled }); setSearchEnabled(enabled); })(); }, [instance, sameCurrentInstance, account?.acct]);