mirror of
https://github.com/moparisthebest/PhoneGap-SQLitePlugin-Android
synced 2024-11-21 08:25:01 -05:00
optimization - we don't want to call back into the js if the query had no callback
This commit is contained in:
parent
b500b78408
commit
adeebc1173
@ -114,7 +114,7 @@
|
||||
if(typeof transId != 'undefined')
|
||||
{
|
||||
console.log("SQLitePluginTransaction.txCompleteCallback---transId:"+transId);
|
||||
if(transId && transaction_callback_queue[transId]['success'])
|
||||
if(transId && transaction_callback_queue[transId] && transaction_callback_queue[transId]['success'])
|
||||
transaction_callback_queue[transId]['success']();
|
||||
|
||||
delete transaction_queue[transId];
|
||||
|
@ -186,8 +186,8 @@ public class SQLitePlugin extends Plugin {
|
||||
params = paramsarr[i];
|
||||
query_id = queryIDs[i];
|
||||
Cursor myCursor = this.myDb.rawQuery(query, params);
|
||||
if(query_id != "")
|
||||
this.processResults(myCursor, query_id, tx_id);
|
||||
|
||||
this.processResults(myCursor, query_id, tx_id);
|
||||
myCursor.close();
|
||||
}
|
||||
this.myDb.setTransactionSuccessful();
|
||||
@ -242,8 +242,8 @@ public class SQLitePlugin extends Plugin {
|
||||
|
||||
result = fullresult.toString();
|
||||
}
|
||||
|
||||
this.sendJavascript(" SQLitePluginTransaction.queryCompleteCallback('" + tx_id + "','" + query_id + "', " + result + ");");
|
||||
if(query_id.length() > 0)
|
||||
this.sendJavascript(" SQLitePluginTransaction.queryCompleteCallback('" + tx_id + "','" + query_id + "', " + result + ");");
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user