@sumaris-net/ngx-components 2.3.0 → 2.3.2

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.
@@ -14553,6 +14553,25 @@ StartableObservableService = __decorate([
14553
14553
  __param(0, Optional())
14554
14554
  ], StartableObservableService);
14555
14555
 
14556
+ function getConnectionType(type) {
14557
+ switch (type) {
14558
+ case Connection.NONE:
14559
+ return 'none';
14560
+ case Connection.ETHERNET:
14561
+ return 'ethernet';
14562
+ case Connection.WIFI:
14563
+ return 'wifi';
14564
+ case Connection.CELL:
14565
+ case Connection.CELL_2G:
14566
+ case Connection.CELL_3G:
14567
+ case Connection.CELL_4G:
14568
+ return 'cellular';
14569
+ case Connection.UNKNOWN:
14570
+ default:
14571
+ return 'unknown';
14572
+ }
14573
+ }
14574
+
14556
14575
  // Base58 encoding/decoding
14557
14576
  // Originally written by Mike Hearn for BitcoinJ
14558
14577
  // Copyright (c) 2011 Google Inc
@@ -14735,25 +14754,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
14735
14754
  args: [{ providedIn: 'root' }]
14736
14755
  }] });
14737
14756
 
14738
- function getConnectionType(type) {
14739
- switch (type) {
14740
- case Connection.NONE:
14741
- return 'none';
14742
- case Connection.ETHERNET:
14743
- return 'ethernet';
14744
- case Connection.WIFI:
14745
- return 'wifi';
14746
- case Connection.CELL:
14747
- case Connection.CELL_2G:
14748
- case Connection.CELL_3G:
14749
- case Connection.CELL_4G:
14750
- return 'cell';
14751
- case Connection.UNKNOWN:
14752
- return 'unknown';
14753
- default:
14754
- return 'ethernet';
14755
- }
14756
- }
14757
14757
  const NetworkRefreshTimerPeriod = {
14758
14758
  MOBILE: 1000 * 60 * 10 /* every 10 min */,
14759
14759
  DESKTOP: 1000 * 60 * 5 /* every 5 min */
@@ -15226,9 +15226,7 @@ class NetworkService extends StartableObservableService {
15226
15226
  return uri;
15227
15227
  }
15228
15228
  onDeviceConnectionChanged(connectionType) {
15229
- connectionType = (connectionType || 'unknown').toLowerCase();
15230
- if (connectionType.startsWith('cell'))
15231
- connectionType = 'cell';
15229
+ connectionType = getConnectionType(connectionType);
15232
15230
  if (connectionType !== this._deviceConnectionType) {
15233
15231
  this._deviceConnectionType = connectionType;
15234
15232
  // If NOT already forced as offline, emit event