forked from FoundKeyGang/FoundKey
remove top level awaits
This commit is contained in:
parent
f6361d947f
commit
f0a019c94f
3 changed files with 373 additions and 370 deletions
|
@ -39,6 +39,7 @@ import { reactionPicker } from '@/scripts/reaction-picker';
|
|||
import { getUrlWithoutLoginId } from '@/scripts/login-id';
|
||||
import { getAccountFromId } from '@/scripts/get-account-from-id';
|
||||
|
||||
(async () => {
|
||||
console.info(`Misskey v${version}`);
|
||||
|
||||
if (_DEV_) {
|
||||
|
@ -437,3 +438,4 @@ if ($i) {
|
|||
|
||||
// shortcut
|
||||
document.addEventListener('keydown', makeHotkey(hotkeys));
|
||||
})();
|
||||
|
|
|
@ -8,4 +8,6 @@ export type UnicodeEmojiDef = {
|
|||
}
|
||||
|
||||
// initial converted from https://github.com/muan/emojilib/commit/242fe68be86ed6536843b83f7e32f376468b38fb
|
||||
export const emojilist = (await import('../emojilist.json')).default as UnicodeEmojiDef[];
|
||||
import _emojilist from '../emojilist.json';
|
||||
|
||||
export const emojilist = _emojilist as UnicodeEmojiDef[];
|
||||
|
|
|
@ -11,15 +11,14 @@ const fallbackName = (key: string) => `idbfallback::${key}`;
|
|||
let idbAvailable = typeof window !== 'undefined' ? !!window.indexedDB : true;
|
||||
|
||||
if (idbAvailable) {
|
||||
try {
|
||||
await iset('idb-test', 'test');
|
||||
} catch (err) {
|
||||
iset('idb-test', 'test').catch(err => {
|
||||
console.error('idb error', err);
|
||||
console.error('indexedDB is unavailable. It will use localStorage.');
|
||||
idbAvailable = false;
|
||||
});
|
||||
} else {
|
||||
console.error('indexedDB is unavailable. It will use localStorage.');
|
||||
}
|
||||
}
|
||||
|
||||
if (!idbAvailable) console.error('indexedDB is unavailable. It will use localStorage.');
|
||||
|
||||
export async function get(key: string) {
|
||||
if (idbAvailable) return iget(key);
|
||||
|
|
Loading…
Reference in a new issue