From e71d1df7021b6d404d9c4934374c5169db80c5f9 Mon Sep 17 00:00:00 2001 From: Mattias Nilsson Date: Thu, 7 Dec 2023 15:02:17 +0100 Subject: [PATCH] Revert "[BUGFIX] Remove unused connector_overrides from JS" This reverts commit 1c8c49ed92c181c92a9da5c011804af5ad527ba9. --- Resources/Public/JavaScript/qbank-connector.js | 13 ++++++++++++- Resources/Public/JavaScript/qbank-connector.min.js | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Resources/Public/JavaScript/qbank-connector.js b/Resources/Public/JavaScript/qbank-connector.js index cb38cda..884376d 100644 --- a/Resources/Public/JavaScript/qbank-connector.js +++ b/Resources/Public/JavaScript/qbank-connector.js @@ -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() { diff --git a/Resources/Public/JavaScript/qbank-connector.min.js b/Resources/Public/JavaScript/qbank-connector.min.js index 2d106fd..3767e80 100644 --- a/Resources/Public/JavaScript/qbank-connector.min.js +++ b/Resources/Public/JavaScript/qbank-connector.min.js @@ -1 +1 @@ -!function(){function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){return e(b[g][1][a]||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g")?b.replace(/[\[\]]/g,""):b.replace(/\[.*?\]/g,""),b=b.replace(/||