@things-factory/tutorial-ui 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.
@@ -8,9 +8,7 @@ import { client, PageView, store } from '@things-factory/shell'
8
8
  import { gqlBuilder } from '@things-factory/utils'
9
9
  import gql from 'graphql-tag'
10
10
  import { css, html } from 'lit'
11
- import { connect } from 'pwa-helpers/connect-mixin.js'
12
-
13
- class TutorialList extends connect(store)(localize(i18next)(PageView)) {
11
+ class TutorialList extends localize(i18next)(PageView) {
14
12
  static get properties() {
15
13
  return {
16
14
  _searchFields: Array,
@@ -281,10 +279,36 @@ class TutorialList extends connect(store)(localize(i18next)(PageView)) {
281
279
  })
282
280
  }
283
281
 
284
- stateChanged(state) {
285
- if (state.auth.user) {
286
- this._user = state.auth && state.auth.user && state.auth.user.id
282
+ private _unsubscribe?: () => void
283
+
284
+
285
+ connectedCallback() {
286
+
287
+ super.connectedCallback()
288
+
289
+ this._applyState()
290
+
291
+ this._unsubscribe = store.subscribe(() => this._applyState())
292
+
293
+ }
294
+
295
+
296
+ disconnectedCallback() {
297
+
298
+ super.disconnectedCallback()
299
+
300
+ this._unsubscribe?.()
301
+
302
+ }
303
+
304
+
305
+ private _applyState() {
306
+
307
+ const __state__ = store.getState() as any
308
+ if (__state__.auth.user) {
309
+ this._user = __state__.auth && __state__.auth.user && __state__.auth.user.id
287
310
  }
311
+
288
312
  }
289
313
 
290
314
  //Filter youtube url to get video id
@@ -4,15 +4,13 @@ import './tutorial-detail'
4
4
 
5
5
  import gql from 'graphql-tag'
6
6
  import { css, html } from 'lit'
7
- import { connect } from 'pwa-helpers/connect-mixin.js'
8
-
9
7
  import { openPopup } from '@operato/layout'
10
8
  import { i18next, localize } from '@operato/i18n'
11
9
  import { client, CustomAlert, PageView, store } from '@things-factory/shell'
12
10
  import { CommonButtonStyles, ScrollbarStyles } from '@things-factory/styles'
13
11
  import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
14
12
 
15
- class TutorialSettingList extends connect(store)(localize(i18next)(PageView)) {
13
+ class TutorialSettingList extends localize(i18next)(PageView) {
16
14
  static get properties() {
17
15
  return {
18
16
  _searchFields: Array,
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@things-factory/tutorial-ui",
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": "joekin",
8
8
  "description": "UI module for handling app tutorial usage",
@@ -24,11 +24,11 @@
24
24
  "migration:create": "node ../../node_modules/typeorm/cli.js migration:create ./server/migrations/migration"
25
25
  },
26
26
  "dependencies": {
27
- "@operato/layout": "^9.0.0",
28
- "@things-factory/i18n-base": "^9.2.5",
29
- "@things-factory/more-base": "^9.2.5",
30
- "@things-factory/shell": "^9.2.5",
31
- "@things-factory/tutorial-base": "^9.2.5"
27
+ "@operato/layout": "^10.0.0-beta.1",
28
+ "@things-factory/i18n-base": "^10.0.0-beta.10",
29
+ "@things-factory/more-base": "^10.0.0-beta.10",
30
+ "@things-factory/shell": "^10.0.0-beta.10",
31
+ "@things-factory/tutorial-base": "^10.0.0-beta.10"
32
32
  },
33
- "gitHead": "d3622f475ae3bab84322d31b064cc4cda20f7062"
33
+ "gitHead": "95acadd39e9a0ff3b2f34d9f7082142395903179"
34
34
  }
File without changes
File without changes
File without changes