@dereekb/dbx-firebase 13.15.0 → 13.17.0

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.
@@ -504,15 +504,15 @@ class DbxFirebaseAnalyticsUserSource {
504
504
  _userPropertiesFactory = new BehaviorSubject(DEFAULT_DBX_FIREBASE_ANALYTICS_USER_PROPERTIES_FACTORY);
505
505
  analyticsUser$ = combineLatest([this._userPropertiesFactory, this.dbxFirebaseAuthService.currentAuthUserInfo$]).pipe(switchMap(([userPropertiesFactory, x]) => {
506
506
  let analyticsUser;
507
- if (x != null) {
507
+ if (x == null) {
508
+ analyticsUser = of(null);
509
+ }
510
+ else {
508
511
  analyticsUser = userPropertiesFactory(x).pipe(map((properties) => ({
509
512
  user: x.uid,
510
513
  properties
511
514
  })));
512
515
  }
513
- else {
514
- analyticsUser = of(null);
515
- }
516
516
  return analyticsUser;
517
517
  }), shareReplay(1));
518
518
  get userPropertiesFactory() {
@@ -941,12 +941,12 @@ class DbxFirebaseLoginButtonComponent {
941
941
  }
942
942
  handleAction = (_, context) => {
943
943
  const config = this.config();
944
- if (config != null) {
945
- const loginPromise = config.handleLogin();
946
- context.startWorkingWithPromise(loginPromise);
944
+ if (config == null) {
945
+ context.reject();
947
946
  }
948
947
  else {
949
- context.reject();
948
+ const loginPromise = config.handleLogin();
949
+ context.startWorkingWithPromise(loginPromise);
950
950
  }
951
951
  };
952
952
  onActionSuccess = () => {
@@ -3091,12 +3091,10 @@ function provideDbxFirebaseFunctions(config) {
3091
3091
  provide,
3092
3092
  useFactory: (lazyFunctions) => {
3093
3093
  const getter = lazyFunctions[key];
3094
- if (!getter) {
3095
- throw new Error(`Could not create provider for firebase function getter "${provide}" as the getter was unavailable.`);
3096
- }
3097
- else {
3094
+ if (getter) {
3098
3095
  return getter();
3099
3096
  }
3097
+ throw new Error(`Could not create provider for firebase function getter "${provide}" as the getter was unavailable.`);
3100
3098
  },
3101
3099
  deps: [config.functionsGetterToken]
3102
3100
  });
@@ -3752,12 +3750,12 @@ class DbxFirebaseModelTypesService {
3752
3750
  }
3753
3751
  getDisplayInfo(typeInfo, data) {
3754
3752
  let displayInfo;
3755
- if (data != null) {
3756
- displayInfo = typeInfo.displayInfoFactory(data);
3757
- displayInfo.icon = displayInfo.icon || typeInfo.icon; // set default icon
3753
+ if (data == null) {
3754
+ displayInfo = this.getDefaultDisplayInfo(typeInfo);
3758
3755
  }
3759
3756
  else {
3760
- displayInfo = this.getDefaultDisplayInfo(typeInfo);
3757
+ displayInfo = typeInfo.displayInfoFactory(data);
3758
+ displayInfo.icon = displayInfo.icon || typeInfo.icon; // set default icon
3761
3759
  }
3762
3760
  return displayInfo;
3763
3761
  }
@@ -4588,15 +4586,15 @@ function addStore(state, store) {
4588
4586
  function removeStore(state, store) {
4589
4587
  const { stores } = state;
4590
4588
  let nextState;
4591
- if (!stores.has(store)) {
4592
- nextState = state;
4593
- }
4594
- else {
4589
+ if (stores.has(store)) {
4595
4590
  // remove the entry
4596
4591
  stores.delete(store);
4597
4592
  // update the last changed date
4598
4593
  nextState = { ...state, currentEntryCount: state.currentEntryCount - 1, lastStoresChangeAt: new Date() };
4599
4594
  }
4595
+ else {
4596
+ nextState = state;
4597
+ }
4600
4598
  return nextState;
4601
4599
  }
4602
4600
 
@@ -5458,7 +5456,10 @@ let AbstractRootSingleItemDbxFirebaseDocument = class AbstractRootSingleItemDbxF
5458
5456
  */
5459
5457
  setFirestoreCollection = this.updater((state, firestoreCollection) => {
5460
5458
  let result;
5461
- if (firestoreCollection != null) {
5459
+ if (firestoreCollection == null) {
5460
+ result = { ...state, firestoreCollection: null };
5461
+ }
5462
+ else {
5462
5463
  const id = firestoreCollection.singleItemIdentifier;
5463
5464
  if (id == null) {
5464
5465
  throw new Error('AbstractRootSingleItemDbxFirebaseDocument only accepts RootSingleItemFirestoreCollection values with a singleItemIdentifier set for setFirestoreCollection.');
@@ -5467,9 +5468,6 @@ let AbstractRootSingleItemDbxFirebaseDocument = class AbstractRootSingleItemDbxF
5467
5468
  result = { ...state, firestoreCollection, id };
5468
5469
  }
5469
5470
  }
5470
- else {
5471
- result = { ...state, firestoreCollection: null };
5472
- }
5473
5471
  return result;
5474
5472
  });
5475
5473
  /**
@@ -5770,16 +5768,16 @@ class AbstractSingleItemDbxFirebaseDocument extends AbstractDbxFirebaseDocumentW
5770
5768
  */
5771
5769
  setFirestoreCollection = this.updater((state, firestoreCollection) => {
5772
5770
  let result;
5773
- if (firestoreCollection != null) {
5771
+ if (firestoreCollection == null) {
5772
+ result = { ...state, firestoreCollection: null };
5773
+ }
5774
+ else {
5774
5775
  const id = firestoreCollection.singleItemIdentifier;
5775
5776
  if (id == null) {
5776
5777
  throw new Error('AbstractSingleItemDbxFirebaseDocument only accepts SingleItemFirestoreCollection values with a singleItemIdentifier set for setFirestoreCollection.');
5777
5778
  }
5778
5779
  result = { ...state, firestoreCollection, id };
5779
5780
  }
5780
- else {
5781
- result = { ...state, firestoreCollection: null };
5782
- }
5783
5781
  return result;
5784
5782
  });
5785
5783
  /**
@@ -6119,10 +6117,7 @@ class DbxFirebaseNotificationItemWidgetService {
6119
6117
  let result = false;
6120
6118
  if (override || !this._entries.has(notificationTemplateType)) {
6121
6119
  const notificationTemplateTypeInfo = this.dbxFirebaseNotificationTemplateService.appNotificationTemplateTypeInfoRecordService.appNotificationTemplateTypeInfoRecord[notificationTemplateType];
6122
- if (!notificationTemplateTypeInfo) {
6123
- console.warn(`DbxFirebaseNotificationItemWidgetService.register(): No known template type info was found for notification type: ${notificationTemplateType}. The entry is not being registered.`);
6124
- }
6125
- else {
6120
+ if (notificationTemplateTypeInfo) {
6126
6121
  const entry = {
6127
6122
  notificationTemplateType,
6128
6123
  notificationTemplateTypeInfo,
@@ -6135,6 +6130,9 @@ class DbxFirebaseNotificationItemWidgetService {
6135
6130
  this.dbxWidgetService.register(entry.widget, override);
6136
6131
  result = true;
6137
6132
  }
6133
+ else {
6134
+ console.warn(`DbxFirebaseNotificationItemWidgetService.register(): No known template type info was found for notification type: ${notificationTemplateType}. The entry is not being registered.`);
6135
+ }
6138
6136
  }
6139
6137
  return result;
6140
6138
  }
@@ -6297,7 +6295,7 @@ class DbxFirebaseNotificationItemStorePopoverButtonComponent extends AbstractPop
6297
6295
  }
6298
6296
  _makePopoverRef(origin) {
6299
6297
  const config = this.config();
6300
- const notificationItemsLoadingState$ = config?.notificationItemsLoadingState$ ?? (this._dbxFirebaseNotificationItemStore != null ? loadingStateFromObs(this._dbxFirebaseNotificationItemStore.items$) : undefined);
6298
+ const notificationItemsLoadingState$ = config?.notificationItemsLoadingState$ ?? (this._dbxFirebaseNotificationItemStore == null ? undefined : loadingStateFromObs(this._dbxFirebaseNotificationItemStore.items$));
6301
6299
  if (!origin) {
6302
6300
  throw new Error('Missing origin.');
6303
6301
  }
@@ -7084,13 +7082,13 @@ class DbxFirebaseStorageFileDownloadButtonComponent {
7084
7082
  const downloadUrl = this.downloadUrlSignal();
7085
7083
  const mimeType = this.downloadMimeTypeSignal();
7086
7084
  const expiresAt = this.downloadUrlExpiresAtDateSignal();
7087
- const details = downloadUrl != null
7088
- ? {
7085
+ const details = downloadUrl == null
7086
+ ? undefined
7087
+ : {
7089
7088
  downloadUrl,
7090
7089
  mimeType,
7091
7090
  expiresAt
7092
- }
7093
- : undefined;
7091
+ };
7094
7092
  return details;
7095
7093
  }, ...(ngDevMode ? [{ debugName: "downloadDetailsSignal" }] : /* istanbul ignore next */ []));
7096
7094
  downloadDetailsChangedEffect = effect(() => {
@@ -7370,7 +7368,7 @@ function storageFileUploadFiles(input) {
7370
7368
  if (nextProgressPercent) {
7371
7369
  // update the overall percentage
7372
7370
  const previousProgress = allFilesAndLatestProgress[fileIndex];
7373
- const previousProgressPercent = previousProgress?.progress != null ? previousProgress.progress * 100 : 0;
7371
+ const previousProgressPercent = previousProgress?.progress == null ? 0 : previousProgress.progress * 100;
7374
7372
  const progressPercentChange = nextProgressPercent - previousProgressPercent;
7375
7373
  // increase overall progress by the change
7376
7374
  nextOverallProgress += progressPercentChange * overallProgressPerCompletedFile;
@@ -8014,7 +8012,7 @@ function provideDbxFirebaseStorageFileService() {
8014
8012
  */
8015
8013
  class FlatFirestoreModelKeyPipe {
8016
8014
  transform(input) {
8017
- return input != null ? flatFirestoreModelKey(input) : '';
8015
+ return input == null ? '' : flatFirestoreModelKey(input);
8018
8016
  }
8019
8017
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: FlatFirestoreModelKeyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
8020
8018
  static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.11", ngImport: i0, type: FlatFirestoreModelKeyPipe, isStandalone: true, name: "flatFirestoreModelKey" });
@@ -8037,7 +8035,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
8037
8035
  */
8038
8036
  class TwoWayFlatFirestoreModelKeyPipe {
8039
8037
  transform(input) {
8040
- return input != null ? twoWayFlatFirestoreModelKey(input) : '';
8038
+ return input == null ? '' : twoWayFlatFirestoreModelKey(input);
8041
8039
  }
8042
8040
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: TwoWayFlatFirestoreModelKeyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
8043
8041
  static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.11", ngImport: i0, type: TwoWayFlatFirestoreModelKeyPipe, isStandalone: true, name: "twoWayFlatFirestoreModelKey" });