From 3a5cc172b347f8b62a7931b8268146fd68543829 Mon Sep 17 00:00:00 2001 From: Betim Beja <11160171+BetimBeja@users.noreply.github.com> Date: Mon, 25 Oct 2021 05:43:12 +0200 Subject: [PATCH] Fixes issues with user list empty (#180) --- app/scripts/background.ts | 3 ++- app/scripts/inject/levelup.servicecalls.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/scripts/background.ts b/app/scripts/background.ts index 072699b..d36eccc 100644 --- a/app/scripts/background.ts +++ b/app/scripts/background.ts @@ -17,7 +17,7 @@ chrome.runtime.onMessage.addListener(function (message: IExtensionMessage, sende let c = message.category.toString(); switch (c) { case 'allUsers': - chrome.tabs.query({ active: true }, function (tabs) { + chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) { chrome.tabs.sendMessage(tabs[0].id, { category: 'allUsers', type: 'Background', @@ -104,6 +104,7 @@ chrome.runtime.onMessage.addListener(function (message: IExtensionMessage, sende chrome.tabs.query( { active: true, + currentWindow: true }, function (tabs) { chrome.tabs.executeScript(tabs[0].id, { diff --git a/app/scripts/inject/levelup.servicecalls.ts b/app/scripts/inject/levelup.servicecalls.ts index 5935531..8ffa816 100644 --- a/app/scripts/inject/levelup.servicecalls.ts +++ b/app/scripts/inject/levelup.servicecalls.ts @@ -137,7 +137,7 @@ export class Service { allUsers() { const userId = - this.utility.Xrm?.Utility?.getGlobalContext()?.getUserId() ?? this.utility.Xrm.Page.context.getUserId(); + this.utility.Xrm?.Utility?.getGlobalContext?.().getUserId() ?? this.utility.Xrm.Page.context.getUserId(); this.utility .fetch( 'systemusers',