Skip to content

Commit 59b8663

Browse files
authored
Merge pull request #4666 from dpalou/MOBILE-4971
MOBILE-4971 ws: Allow disable group WS requests during development
2 parents 264e791 + 08c4327 commit 59b8663

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/core/classes/sites/authenticated-site.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import { CoreWait } from '@singletons/wait';
4545
import { CorePromiseUtils } from '@singletons/promise-utils';
4646
import { CoreObject } from '@singletons/object';
4747
import { CoreArray } from '@singletons/array';
48+
import { CoreBrowser } from '@singletons/browser';
4849

4950
/**
5051
* Class that represents a site (combination of site + user) where the user has authenticated but the site hasn't been validated
@@ -863,7 +864,7 @@ export class CoreAuthenticatedSite extends CoreUnauthenticatedSite {
863864
preSets: CoreSiteWSPreSets,
864865
wsPreSets: CoreWSPreSets,
865866
): Promise<T> {
866-
if (preSets.skipQueue || !this.wsAvailable('tool_mobile_call_external_functions')) {
867+
if (preSets.skipQueue || !this.wsAvailable('tool_mobile_call_external_functions') || !this.shouldGroupWSRequests()) {
867868
return CoreWS.call<T>(method, data, wsPreSets);
868869
}
869870

@@ -1042,6 +1043,15 @@ export class CoreAuthenticatedSite extends CoreUnauthenticatedSite {
10421043
}
10431044
}
10441045

1046+
/**
1047+
* Check if WS requests should be grouped.
1048+
*
1049+
* @returns Whether WS requests should be grouped.
1050+
*/
1051+
protected shouldGroupWSRequests(): boolean {
1052+
return !CoreUtils.isFalseOrZero(CoreBrowser.getDevelopmentSetting('GroupWSRequests') ?? true);
1053+
}
1054+
10451055
/**
10461056
* Check if a WS is available in this site.
10471057
*

0 commit comments

Comments
 (0)