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 { masto } = api({ instance });
|
||||||
const results = masto.v2.search.fetch({
|
const results = await masto.v2.search.fetch({
|
||||||
q: 'from:me',
|
q: 'from:me',
|
||||||
type: 'statuses',
|
type: 'statuses',
|
||||||
limit: 1,
|
limit: 1,
|
||||||
|
@ -72,6 +72,7 @@ function AccountStatuses() {
|
||||||
if (!account?.acct) return;
|
if (!account?.acct) return;
|
||||||
(async () => {
|
(async () => {
|
||||||
const enabled = await isSearchEnabled(instance);
|
const enabled = await isSearchEnabled(instance);
|
||||||
|
console.log({ enabled });
|
||||||
setSearchEnabled(enabled);
|
setSearchEnabled(enabled);
|
||||||
})();
|
})();
|
||||||
}, [instance, sameCurrentInstance, account?.acct]);
|
}, [instance, sameCurrentInstance, account?.acct]);
|
||||||
|
|
Loading…
Reference in a new issue