mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-25 18:55:44 +03:00
Fix async/await
This commit is contained in:
parent
137ad7f4dd
commit
66f9c3b918
1 changed files with 3 additions and 2 deletions
|
@ -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]);
|
||||
|
|
Loading…
Reference in a new issue