@things-factory/offline-base 9.2.5 → 10.0.0-beta.10

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.
@@ -1,5 +1,4 @@
1
1
  import { store } from '@operato/shell'
2
- import { installOfflineWatcher } from 'pwa-helpers/network.js'
3
2
 
4
3
  import offline from './reducers/offline'
5
4
  import { UPDATE_OFFLINE } from './actions/offline'
@@ -9,10 +8,14 @@ export default function bootstrap() {
9
8
  offline
10
9
  })
11
10
 
12
- installOfflineWatcher(offline => {
11
+ const updateOfflineStatus = () => {
13
12
  store.dispatch({
14
13
  type: UPDATE_OFFLINE,
15
- offline: offline
14
+ offline: !navigator.onLine
16
15
  })
17
- })
16
+ }
17
+
18
+ updateOfflineStatus()
19
+ window.addEventListener('online', updateOfflineStatus)
20
+ window.addEventListener('offline', updateOfflineStatus)
18
21
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@things-factory/offline-base",
3
- "version": "9.2.5",
3
+ "version": "10.0.0-beta.10",
4
4
  "main": "dist-server/index.js",
5
- "browser": "client/index.js",
5
+ "browser": "client/index.ts",
6
6
  "things-factory": true,
7
7
  "author": "heartyoh <heartyoh@hatiolab.com>",
8
8
  "description": "Module that make app run in offline mode.",
@@ -24,7 +24,7 @@
24
24
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create ./server/migrations/migration"
25
25
  },
26
26
  "dependencies": {
27
- "@things-factory/shell": "^9.2.5"
27
+ "@things-factory/shell": "^10.0.0-beta.10"
28
28
  },
29
- "gitHead": "d3622f475ae3bab84322d31b064cc4cda20f7062"
29
+ "gitHead": "95acadd39e9a0ff3b2f34d9f7082142395903179"
30
30
  }
File without changes
File without changes
File without changes