@3dsource/angular-unreal-module 0.0.22 → 0.0.24

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.
@@ -4,7 +4,7 @@ import { filter, withLatestFrom, distinctUntilChanged, first, catchError, map, t
4
4
  import { createAction, props, createReducer, on, createFeature, Store, createSelector } from '@ngrx/store';
5
5
  import { Actions, createEffect, ofType } from '@ngrx/effects';
6
6
  import { skip, share, merge, timer, of, Subject, combineLatest, switchMap, timeout, retryWhen, take, fromEvent, from, tap as tap$1, interval, startWith, combineLatestWith, takeUntil as takeUntil$1, auditTime, map as map$1, EMPTY, debounceTime as debounceTime$1, scan, Observable, BehaviorSubject, first as first$1, distinctUntilChanged as distinctUntilChanged$1, concat } from 'rxjs';
7
- import { concatLatestFrom } from '@ngrx/operators';
7
+ import { concatLatestFrom, mapResponse } from '@ngrx/operators';
8
8
  import { Falsy, Truthy, Logger, generateUuid, tapLog, COLOR_CODES, calculateMedian, clampf, Signal, where, KeyboardNumericCode, InvertedKeyMap, Semaphore, isEmpty, lerp, smoothTransition, getCanvasCached, getSnapshot, whereNot, HEXtoRGB, RGBtoHSV, inverseLerp, HSVtoRGB, RGBtoHEX, fpIsASameAsB, fitIntoRectangle } from '@3dsource/utils';
9
9
  import { toSignal, takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
10
10
  import { HttpClient } from '@angular/common/http';
@@ -3210,32 +3210,49 @@ class UnrealEffects {
3210
3210
  return this.actions$.pipe(ofType(destroyRemoteConnections), filter(({ disconnectReason }) => disconnectReason === DisconnectReason.dataChannelTimeout), switchMap(() => this.actions$.pipe(ofType(resetUnrealState), first())), map$1(() => initSignalling()));
3211
3211
  });
3212
3212
  this.showUnrealError$ = createEffect(() => {
3213
- return this.actions$.pipe(ofType(showUnrealErrorMessage), map$1(({ error, code }) => ({
3214
- message: getRtcErrorMessage(code),
3215
- data: { error, code },
3216
- })), distinctUntilChanged(), filter(({ message }) => Truthy(message)), concatLatestFrom(() => [
3213
+ return this.actions$.pipe(ofType(showUnrealErrorMessage), map$1(({ code }) => getRtcErrorMessage(code)), distinctUntilChanged(), filter(Truthy), switchMap((content) => this.dialog.open(UnrealErrorModalComponent, {
3214
+ scrollStrategy: this.scrollStrategy,
3215
+ data: { content },
3216
+ }).closed), map$1(() => showUnrealErrorMessage({ code: null })));
3217
+ });
3218
+ this.sendStatisticsToUnreal$ = createEffect(() => {
3219
+ return this.actions$.pipe(ofType(showUnrealErrorMessage), filter(({ code }) => code === 404), concatLatestFrom(() => [
3217
3220
  this.store.select(unrealFeature.selectAwsInstance),
3218
3221
  this.store.select(unrealFeature.selectStreamClientCompanyId),
3219
3222
  this.store.select(unrealFeature.selectStreamViewId),
3220
- ]), switchMap(([data, instance, companyId, viewId]) => {
3221
- if (data?.data && data?.data.code === 404) {
3222
- this.http.post(this.unrealInitialConfig?.customErrorsEndpoint || '', {
3223
- client: instance.pollingUrl,
3224
- session_uuid: companyId,
3225
- session_uuid2: viewId,
3226
- message: {
3227
- type: 'front',
3228
- error: `pak_not_found::${data.data?.error ?? ''}`,
3229
- signalling: instance.pollingUrl,
3230
- },
3231
- });
3232
- }
3233
- return this.dialog.open(UnrealErrorModalComponent, {
3234
- scrollStrategy: this.scrollStrategy,
3235
- data: { content: data.message },
3236
- }).closed;
3237
- }), map$1(() => showUnrealErrorMessage({ code: null })));
3238
- });
3223
+ ]), switchMap(([action, instance, companyId, viewId]) => {
3224
+ console.log('this.unrealInitialConfig?.customErrorsEndpoint', this.unrealInitialConfig?.customErrorsEndpoint);
3225
+ console.log('data', {
3226
+ client: instance.pollingUrl,
3227
+ session_uuid: companyId,
3228
+ session_uuid2: viewId,
3229
+ message: {
3230
+ type: 'front',
3231
+ error: `pak_not_found::${action?.error ?? ''}`,
3232
+ signalling: instance.pollingUrl,
3233
+ },
3234
+ });
3235
+ return this.http
3236
+ .post(this.unrealInitialConfig?.customErrorsEndpoint || '', {
3237
+ client: instance.pollingUrl,
3238
+ session_uuid: companyId,
3239
+ session_uuid2: viewId,
3240
+ message: {
3241
+ type: 'front',
3242
+ error: `pak_not_found::${action?.error ?? ''}`,
3243
+ signalling: instance.pollingUrl,
3244
+ },
3245
+ })
3246
+ .pipe(mapResponse({
3247
+ next: () => {
3248
+ console.log('mapResponse next success');
3249
+ },
3250
+ error: () => {
3251
+ console.log('mapResponse next error');
3252
+ },
3253
+ }));
3254
+ }));
3255
+ }, { dispatch: false });
3239
3256
  this.initAppBySetDataChannelConnected$ = createEffect(() => {
3240
3257
  return this.actions$.pipe(ofType(setDataChannelConnected), tap(() => {
3241
3258
  this.commandsSender.sendCommandToUnreal(getExecuteConsoleCommand({