Skip to content

Commit c45f702

Browse files
authored
Merge pull request #9 from SillyLittleTech/codex/fix-async-functions-without-await-in-javascript
Fix JS-0116 warnings in wiki-data-manager ensureIndex
2 parents 25f5d30 + 5a3d3f3 commit c45f702

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

ios/extention/Resources/scripts/wiki-data-manager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ let _wikiIndex = null
111111
let _wikiIndexPromise = null
112112

113113
/** Ensure the in-memory lookup index is built. */
114-
async function ensureIndex () {
115-
if (_wikiIndex !== null) return _wikiIndex
114+
function ensureIndex () {
115+
if (_wikiIndex !== null) return Promise.resolve(_wikiIndex)
116116
if (_wikiIndexPromise) return _wikiIndexPromise
117117
_wikiIndexPromise = getWikiData().then(data => {
118118
_wikiIndex = buildIndex(data)

mos/Flean Extension/Resources/scripts/wiki-data-manager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ let _wikiIndex = null
111111
let _wikiIndexPromise = null
112112

113113
/** Ensure the in-memory lookup index is built. */
114-
async function ensureIndex () {
115-
if (_wikiIndex !== null) return _wikiIndex
114+
function ensureIndex () {
115+
if (_wikiIndex !== null) return Promise.resolve(_wikiIndex)
116116
if (_wikiIndexPromise) return _wikiIndexPromise
117117
_wikiIndexPromise = getWikiData().then(data => {
118118
_wikiIndex = buildIndex(data)

0 commit comments

Comments
 (0)