Skip to content

Commit

Permalink
Yield async DB read/write ops
Browse files Browse the repository at this point in the history
  • Loading branch information
fbennett committed Feb 19, 2017
1 parent 78d2609 commit c716a28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chrome/content/zotero/preferences/preferences_lang.js
Expand Up @@ -584,7 +584,7 @@ Zotero_Preferences.Lang = {

langPrefIsSet: Zotero.Promise.coroutine(function* (profile,tag,param) {
var sql = 'SELECT COUNT(*) FROM zlsPreferences WHERE profile=? AND tag=? AND param=?';
var res = Zotero.DB.valueQueryAsync(sql,[profile, tag, param]);
var res = yield Zotero.DB.valueQueryAsync(sql,[profile, tag, param]);
return res;
}),

Expand All @@ -596,10 +596,10 @@ Zotero_Preferences.Lang = {
var enable = target.hasAttribute('checked');
if (enable) {
var sql = 'INSERT INTO zlsPreferences VALUES (?,?,?)';
Zotero.DB.queryAsync(sql,['default',param,tag]);
yield Zotero.DB.queryAsync(sql,['default',param,tag]);
} else {
var sql = 'DELETE FROM zlsPreferences WHERE profile=? AND param=? and tag=?';
Zotero.DB.queryAsync(sql,['default',param,tag]);
yield Zotero.DB.queryAsync(sql,['default',param,tag]);
}
yield Zotero.CachedLanguagePreferences.init();
var langRow = document.getElementById(tag+'::row');
Expand Down

0 comments on commit c716a28

Please sign in to comment.