quickblox-react-ui-kit 0.2.8-beta.18 → 0.2.8-beta.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index-ui.js CHANGED
@@ -24484,6 +24484,7 @@ __webpack_require__.r(__webpack_exports__);
24484
24484
  /* harmony import */ var _Domain_use_cases_RemoveUsersFromTheDialogUseCase__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../Domain/use_cases/RemoveUsersFromTheDialogUseCase */ "./src/Domain/use_cases/RemoveUsersFromTheDialogUseCase.ts");
24485
24485
  /* harmony import */ var _Domain_use_cases_GetUsersByIdsUseCase__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../Domain/use_cases/GetUsersByIdsUseCase */ "./src/Domain/use_cases/GetUsersByIdsUseCase.ts");
24486
24486
  /* harmony import */ var _Data_repository_UsersRepository__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../Data/repository/UsersRepository */ "./src/Data/repository/UsersRepository.ts");
24487
+ /* harmony import */ var _Data_DefaultConfigurations__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../Data/DefaultConfigurations */ "./src/Data/DefaultConfigurations.ts");
24487
24488
  var __assign = (undefined && undefined.__assign) || function () {
24488
24489
  __assign = Object.assign || function(t) {
24489
24490
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -24559,6 +24560,7 @@ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from
24559
24560
 
24560
24561
 
24561
24562
 
24563
+
24562
24564
 
24563
24565
  function useDialogListViewModel(currentContext, initPagination) {
24564
24566
  var _this = this;
@@ -24578,6 +24580,11 @@ function useDialogListViewModel(currentContext, initPagination) {
24578
24580
  var eventMessageRepository = currentContext.storage.EVENT_MESSAGE_REPOSITORY;
24579
24581
  var useCaseSubscribeToDialogsUpdates = new _Domain_use_cases_SubscribeToDialogsUpdatesUseCaseWithMock__WEBPACK_IMPORTED_MODULE_2__.SubscribeToDialogsUpdatesUseCaseWithMock(new _Data_repository_DialogsRepository__WEBPACK_IMPORTED_MODULE_3__["default"](currentContext.storage.LOCAL_DATA_SOURCE, remoteDataSourceMock));
24580
24582
  var subscribeToDialogEventsUseCase = new _Domain_use_cases_SubscribeToDialogEventsUseCase__WEBPACK_IMPORTED_MODULE_12__.SubscribeToDialogEventsUseCase(eventMessageRepository, 'DialogsViewModel');
24583
+ //
24584
+ var QBConfig = currentContext.InitParams.qbConfig ||
24585
+ _Data_DefaultConfigurations__WEBPACK_IMPORTED_MODULE_20__.DefaultConfigurations.getDefaultQBConfig();
24586
+ var regexUserName = QBConfig.appConfig.regexUserName;
24587
+ var regex = regexUserName ? new RegExp(regexUserName) : null;
24581
24588
  function getDialogs(currentPagination) {
24582
24589
  return __awaiter(this, void 0, void 0, function () {
24583
24590
  var useCaseGetAllDialogs;
@@ -24590,7 +24597,20 @@ function useDialogListViewModel(currentContext, initPagination) {
24590
24597
  useCaseGetAllDialogs = new _Domain_use_cases_GetAllDialogsUseCaseWithMock__WEBPACK_IMPORTED_MODULE_4__.GetAllDialogsUseCaseWithMock(new _Data_repository_DialogsRepository__WEBPACK_IMPORTED_MODULE_3__["default"](currentContext.storage.LOCAL_DATA_SOURCE, remoteDataSourceMock), currentPagination);
24591
24598
  return [4 /*yield*/, (useCaseGetAllDialogs === null || useCaseGetAllDialogs === void 0 ? void 0 : useCaseGetAllDialogs.execute().then(function (result) {
24592
24599
  console.log('EXECUTE COMPLETED: ', JSON.stringify(currentPagination));
24593
- setDialogs(__spreadArray([], result.ResultData, true));
24600
+ //
24601
+ var tmpItems = result.ResultData.reduce(function (acc, u) {
24602
+ var isPrivate = u.type === _Domain_entity_DialogTypes__WEBPACK_IMPORTED_MODULE_16__.DialogType["private"];
24603
+ var isValidName = regex && u.name && u.name.length > 0 && regex.test(u.name);
24604
+ if (isPrivate && !isValidName) {
24605
+ // eslint-disable-next-line no-param-reassign
24606
+ u.name = 'Unknown';
24607
+ }
24608
+ acc.push(u);
24609
+ return acc;
24610
+ }, []);
24611
+ //
24612
+ // setDialogs([...(result.ResultData as PublicDialogEntity[])]);
24613
+ setDialogs(__spreadArray([], tmpItems, true));
24594
24614
  setLoading(false);
24595
24615
  setPagination(result.CurrentPagination);
24596
24616
  }).catch(function (e) {