Skip to content

Commit

Permalink
Revert "[BUGFIX] Remove unused connector_overrides from JS"
Browse files Browse the repository at this point in the history
This reverts commit 1c8c49e.
  • Loading branch information
MattiasNilsson committed Dec 7, 2023
1 parent ce3e49d commit e71d1df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion Resources/Public/JavaScript/qbank-connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,24 @@
* Returns an object with user AND potential connector config override for the current user
*/
this.getUser = function() {
var delayed = new QBCJQ.Deferred(), userRequest = this.call("accounts/me"), object = {};
var delayed = new QBCJQ.Deferred(), userRequest = this.call("accounts/me"), settingsRequest = this.call("accounts/settings.json/connector_override"), object = {};
userRequest.then(function(user) {
object.user = user;
if (object.settings !== undefined) {
delayed.resolve(object);
}
});
settingsRequest.then(function(settings) {
object.settings = JSON.parse(settings);
if (object.user) {
delayed.resolve(object);
}
}, function() {
object.settings = false;
if (object.user) {
delayed.resolve(object);
}
});
return delayed;
};
this.listCategories = function() {
Expand Down
2 changes: 1 addition & 1 deletion Resources/Public/JavaScript/qbank-connector.min.js

Large diffs are not rendered by default.

0 comments on commit e71d1df

Please sign in to comment.