Optimize Firebase

This commit is contained in:
tom5079
2022-01-20 18:05:18 +09:00
parent 9781d7a5dc
commit edc7053e50
7 changed files with 13 additions and 15 deletions

View File

@@ -66,7 +66,7 @@ suspend fun WebView.evaluate(script: String): String = coroutineScope {
@OptIn(ExperimentalCoroutinesApi::class)
suspend fun WebView.evaluatePromise(
script: String,
then: String = ".then(result => Callback.onResult(%uid, JSON.stringify(result))).catch(err => { console.err(err); Callback.onError(%uid, JSON.stringify(err)); })"
then: String = ".then(result => Callback.onResult(%uid, JSON.stringify(result))).catch(err => Callback.onError(%uid, JSON.stringify(err)))"
): String = coroutineScope {
var result: String? = null

View File

@@ -43,7 +43,6 @@ suspend fun getSuggestionsForQuery(query: String) : List<Suggestion> {
then = """
.then(r => {
let [results, results_serial] = r;
console.log(results_serial, r, search_serial);
if (search_serial !== results_serial) {
Callback.onResult(%uid, '[]');
} else {